inFocus Tutorials

sticky (2 posts) (2 voices)

  1. Elliott
    Support

    Homepage
    Getting a sidebar to display on the homepage
    Displaying your blog page on your homepage.
    Getting your portfolio gallery to show on the home page.

    Shortcodes
    Fancy Images shortcode for inFocus

    Slider
    How to get your slider to appear on multiple pages.

    Blog Page
    inFocus WP Theme: Display Blog Post Images on Single Blog Post Pages at tech-otaku.com - By nuxx
    inFocus WP Theme: Customising the Display of Post Excerpts at tech-otaku.com - By nuxx
    How to create multiple blog pages
    Getting full post content to display in the blog page.
    Resizing the blog page image.
    Turning your posts into full width.

    Gallery / Portfolio
    How to decrease the size of your fullsize portfolio image when viewed in the post.
    Getting HighSlide to work with inFocus.
    Ceate a gallery without using posts.
    Having multiple images load into a lightbox for your portfolio entries. (sort of like an additional gallery)
    How to change the dimensions of your portfolio images

    Widgets
    Getting the same widget on multiple pages
    Displaying Recent Posts within page content.

    Footer
    3 columns instead of 5

    Misc
    inFocus Social Media Icons at tech-otaku.com - By nuxx
    inFocus translation with .mo file. - By MayaS
    Translating texts manually
    Getting inFocus support for WP 3.0 Menus
    Getting inFocus support for WP 3.0 Menus - Variation
    Translating the latest tweets to another language.
    Building your own custom post type with inFocus.
    Using Cufon
    Integrating Google maps - By scoc
    Offering a style switcher for your users - By giggi

    Thank you for everyone who has taken the time to write a tutorial. If you have written a tutorial regarding inFocus then please post a reply here. :)

    Posted 7 years ago #
  2. IgorIlecic
    Member

    Different layouts for blog categories with use of integrated shortcodes!

    NOTICE: Before editing theme files please MAKE BACKUP of your theme files!

    This is functional representation where posts are products and post categories are categories of products.

    *****GOAL****

    In this tutorial you will achieve:
    1. Create different category archive page
    2. Create layout of specific category page with use of integrated shortcodes
    3. Get breadcrumbs to appear correctly with true category hierarchy (no need for pages)
    4. Post is equal to product & Post category is equal to product category
    5. Get rid of Category archive text and get clean display with only real category name

    First little bit of wordpress codex so maybe you will get even more ideas what can you do:

    **** DOCUMENTATION ****

    I have found in wordpress codex this section that explains template hierarchy:
    http://codex.wordpress.org/Template_Hierarchy

    Examples
    If your blog is at http://example.com/blog/ and a visitor clicks on a link to a category page like http://example.com/blog/category/your-cat/: Here is the progression of how WordPress uses the template hierarchy to find and generate the right file.

    WordPress looks for a template file in the current Theme's directory that matches the category's ID.

    If the category's ID is 4, WordPress looks for a template file named category-4.php.
    If it is missing, WordPress next looks for a generic category template file, category.php.
    If this file does not exist either, WordPress looks for a generic archive template, archive.php.
    If it is missing as well, WordPress falls back on the main Theme template file, index.php.

    ****TUTORIAL*****

    1. Create php file from archive.php so it looks like this:

    <?php
    /**
    * Archive Template
    *
    * @package Mysitemyway
    * @subpackage Template
    */
     
    get_header(); ?>
     
    <?php if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } ?>
     
    <?php echo do_shortcode('[blog_list thumb="large" category_in="16" disable="meta"]'); ?>
     
    <?php mysite_after_page_content(); ?>
     
    <div class="clearboth"></div>
    </div><!-- #main_inner -->
    </div><!-- #main -->
     
    <?php get_footer(); ?>

    2. Name that file like category-ID.php , so if ID of your post category that you want custom layout is 15, then you will name that file category-15.php and upload that file to /wp-content/themes/infocus/ directory.

    3. You need to change also this part of that file with your custom shortcode, what ever layout you want it is possible, just create that layout in wordpress editor with shortcode generator and the paste that code.

    <?php echo do_shortcode('[blog_list thumb="large" category_in="15" disable="meta"]'); ?>

    4. Breadcrumbs are fixed with installing WordPress SEO plugin by Yoast and turning it on clicking on Internal links menu and selecting Taxonomy for posts to be Category.

    5. To properly integrate breadcrumbs you will need to add code below to every template in theme where you want to breadcrumbs to show.

    <?php if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } ?>

    The code must be added just after get_header instance.
    Also you must turn off the breadcrumbs in infocus and add into custom css this:
    #breadcrumbs, #breadcrumbs a {
    margin-top: -40px;
    }

    6. The last thing is to change category title do display real name and not "Archive" and remove text "Category Archive for:"

    This is done by changing /wp-content/themes/infocus/lib/functions/theme.php
    The code that needs to be changed is around 1072 line, and it must look like this after change:

    if ( is_archive() ) {
    		$intro_options = mysite_get_setting( 'intro_options' );
    		if( $intro_options != 'disable' ) {
    			$title = single_cat_title('',false);
    			if( is_category() ) {
    					$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . single_cat_title('',false) . '&rsquo;');
    			} elseif ( is_tag () ) {
    				$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . single_tag_title('',false) . '&rsquo;');
    			} elseif ( is_day() ) {
    				$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . get_the_time('F jS, Y') . '&rsquo;');
    			} elseif ( is_month() ) {
    				$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . get_the_time('F, Y') . '&rsquo;');
    			} elseif ( is_year() ) {
    				$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . get_the_time('Y') . '&rsquo;');
    			} elseif ( is_author() ) {
    				$curauth = get_userdata( intval($author) );
    				$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . $curauth->nickname . '&rsquo;');
    			} elseif ( is_tax() ) {
    				$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    				$text = sprintf( __('', MYSITE_TEXTDOMAIN ), '&lsquo;' . $term->name . '&rsquo;');
    			}
    		}
    	}

    I think that is it, if I messed something sorry it was not on purpose, please comment if need help...

    V.

    Posted 4 years ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme