This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Post Grid: Full Post

  • Creator
    Topic
  • #7069
    piradyne
    Participant

    Hi, how can I display a post grid, but have it display the full post. I could then use this to display a grid of items in my product store. I tried creating a new template. I took the content-grid.php and named it content-gridpost.php, added
    <?php /*
    Template Name: Full Posts in Grid
    */
    at the top just to see if this works as normal, but I get a blank screen when the page is shown. I was planning to change the_excerpt() to the_content(), but I'm guessing there is more to it.

    My question, what is the best way to display a full post in grid format?

    Thanks

    Jarrod

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #7074
    Jason Bobich
    Keymaster

    Hello Jarrod,

    In this case, you’re not working with a page template, so you don’t need to set it up like this. Simply take content-grid.php, copy this to your Child theme, and leave it named as-is.

    Then, within this file, change the_excerpt() to the_content().

    Here’s more information on the subject of template parts:

    http://dev.themeblvd.com/tutorial/editable-content-files/

    #7077
    piradyne
    Participant

    Jason, wonderful, this worked out well. Thank you.

    Jarrod

    #7078
    piradyne
    Participant

    Hmm…. poking around in the theme options and under contents in the post grid section, excerpts are turned off by default. If I turn them on, then the full content is displayed if there is no excerpt define, which is what I was wanting I guess. So bravo, this already does what I need without having to modify the template.

    Now, is it possible to control this per post grid vs globally?

    Thanks

    Jarrod

    #7079
    Jason Bobich
    Keymaster

    If I turn them on, then the full content is displayed if there is no excerpt define

    It actually is just displaying the first 55 words from your post with no shortcodes. That’s all WP does for the excerpt, when you don’t define one, but that’s not going to be the same as actually displaying the_content().

    Now, is it possible to control this per post grid vs globally?

    What you’d do is include a different template part. Checkout that article I linked you to above on template parts. When you filter the template part for “grid” you’d do it with some conditional.

    http://codex.wordpress.org/Conditional_Tags

    For example, say you made a file called content-grid-2.php and you wanted it to be used on the post grid of page 123 —

    function my_template_parts( $parts ) {
        
        if( is_page( 123 ) ) {
        
    		// non-paginated post grids
    		$parts['grid'] = 'grid-2';
    		
    		// paginated post grids
    		$parts['grid_paginated'] = 'grid-2';
         
        }
        
        return $parts;
    }
    add_filter( 'themeblvd_template_parts', 'my_template_parts' );
    #7080
    piradyne
    Participant

    Ahh yea, just discovered that it does not parse my shortcodes. Sigh. I added this in functions.php and it seem to work:

    add_filter(‘the_excerpt’, ‘do_shortcode’);

    Will this mess up my RSS feeds?

    template parts…. ok thanks very much.

    Jarrod

    #7082
    Jason Bobich
    Keymaster

    I’m honestly not quite sure of the effect on the RSS Feeds.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The forum ‘Akita Responsive WordPress Theme’ is closed to new topics and replies.