Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #10706

    Hi,

    I’m trying to reformat my post index layout with a featured image thumbnail on the left and title, date, excerpt to the right as illustrated below. Do I need to create a new dynamic template or post layout or something else.


    | | POST TITLE

    | | POST DATE

    | featured |

    | image | EXCERPT……………………………………………….

    | thumbnail | ……………………………………………………………..

    | | ……………………………………………………………..

    | |

    | | Read More




    | | POST TITLE

    | | POST DATE

    | featured |

    | image | EXCERPT……………………………………………….

    | thumbnail | ……………………………………………………………..

    | | ……………………………………………………………..

    | |

    | | Read More


    Also, how do I include a featured image for the post index thumbnail without a slideshow container appearing at the top of the post on the post detail page?

    Thanks.

    Michael

    #69061

    Looks like this support forum strips spaces our of posts so my illustration didn’t look so good. Anyways, please visualize a square thumbnail to the left with the title, date and excerpt stacked vertically to the right of the thumbnail.

    #69062

    Hey michaelspencer,

    The blog loop is called with the loop-index.php page inside the includes folder. Within this loop, there is a check to see what kind of blog post is being displayed which then gets formatted according to the format-[name of type].php.

    So, to change the standard blog post format, you’ll need to open up the format-standard.php file and edit the data there as well as adding the new css in the custom.css file. If you also want to change the format of the other types of posts, you’ll need to do the same with those files.

    To remove the image appearing at the top of the single post page, you would need to open format-standard.php and change:

    $slider = new avia_slideshow(get_the_ID());
    if($slider) echo $slider->display();

    to

    if(is_singular())
    {
    echo '<hr>';
    }
    else
    {
    $slider = new avia_slideshow(get_the_ID());
    if($slider) echo $slider->display();
    }

    I’ve added an HR tag to break up the header and content, but you can use the model as a base for whatever you want.

    I hope this helps get you started, unfortunately I can’t give you a complete solution as its a bit out of the scope of what we can offer with support.

    Regards,

    Devin

    #69063

    Devin,

    Thank you. This is helpful.

    A quick follow-up question:

    How can I retrieve and display each post’s singular slideshow image as a featured image when looping through loop-index.php?

    Best,

    Michael

    #69064

    I’ve managed to reformat the index of posts (loop_index.php) to the desired style. However, now when I navigate from the index of posts to an individual post, the individual post now has the same format as each entry in the index of posts. This is not correct. I need the individual post page to display each individual post with the original format from the theme. How can I achieve a different layout on the loop_index.php page from the format_standard.php page?

    #69065

    Hi Michael,

    The code I provided above removes the image from the single page and displays it normally on the blog. If you want the single page to look normally, you would need to revert the changes to the original code.

    The loop_index displays what is on the format_standard.php so I’m not sure what you are asking.

    Regards,

    Devin

    #69066

    Thank Devin but I don’t seem to be making myself clear.

    What I am asking is that the style of each post listed in the post index page be DIFFERENT from the style of each post as it is presented in the single page.

    I understand that loop_index.php presents the post with format_standard.php and that format_standard.php is also used to present the post in the single page. But, as I said, I need the presentation to be different in each of these two contexts.

    What I have done is to replicate the PHP from format_standard into loop_index.php and modified it to the style that I need. This worked well and the list of posts now appear as needed. However, now the post appears on the single page with the same modified style as presented in the list instead of with the original format_standard.php style.

    The title in loop_index.php links to the post’s single page per the original theme code:

    <a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:','avia_framework')?> <?php the_title(); ?>"><?php the_title(); ?></a>

    What I don’t understand is why the single post page is presenting the post with the same style that I have now added to the loop_index.php instead of the original format_standard.php style.

    What am I missing here?

    #69067

    Ok, after rolling-up my sleeves and digging into the inner-workings of WordPress template and theme structures I now understand better the answer that you provided above.

    So loop_index.php is called by WordPress once to render the post index (blog) and again to render the single post page. What I didn’t understand at first was how the same loop_index.php could generate two different layouts, one for the post index and another for the single post. But now I see that loop_index.php does exactly that using conditional logic based on is_singular() and is_single() to detect when it is being called to display the post index versus a single post.

    Now that I understand this I can structure each of these two pages differently using this conditional logic.

    Thanks for your help!

    #69068

    Hi!

    Glad Devin could help you!

    Closing this post.

    Regards,

    Mya

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘New Post Index Layout’ is closed to new replies.