Support » Theme: BoldR Lite » Excerpt title above featured image?

  • Resolved Carl Donovan


    I’d like to have the post title and excerpt above the featured image, limited to a particular category. The rest of the posts excerpts to stay as they are. Is this possible?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Iceable



    Yes this is possible, but will require a bit of custom coding in index.php

    I think the idea would rather be moving the featured image below the title and excerpt (same result but different approach in the code), only for the desired category.

    The featured image is already wrapped in a conditional tag on line 89:
    <?php if ( '' != get_the_post_thumbnail() ):

    Here you can add the condition that the post is not in the target category:
    <?php if ( '' != get_the_post_thumbnail() && ! in_category( 'target-cat-slug' ) ):

    So the featured image won’t be displayed above the content for posts in this category.

    Now you want to display it under the content, so copy the whole featured image code block (from the line mentioned above down to “endif; ?>” on line 95, and paste it after the content div. It should look like:

    [line 107]		</div>
    <?php [INSERT CODE HERE] ?>
    	<br class="clear" />
    </div><!-- end div post -->

    And in this code change the condition to:

    <?php if ( '' != get_the_post_thumbnail() && in_category( 'target-cat-slug' ) ):

    And this will do the trick.

    Thanks so much for your quick and thorough response. The level of support you offer on a free theme is a rare beauty.

    I have another question, if I may… Is there an easy way to show post excerpts only on the home page while showing full content on category pages? I’m working with the Blog in Blog plugin at the moment but I’m afraid it might be too much for the client to handle on their own in the future.


    Theme Author Iceable


    Sure this is possible too; requires a small change in index.php as well but easier:

    There is already a conditional switch to display either the_excerpt() or the_content(); so if you set the theme to display the excerpt from Theme Options, you will then just need to add a condition to display the content instead on category pages:

    Original code:

    if ( get_post_format() || post_password_required() || "Full content" == boldr_get_option('blog_index_shows') ) the_content();
    else the_excerpt();

    Your customization:

    if ( get_post_format() || post_password_required() || "Full content" == boldr_get_option('blog_index_shows') || is_category() ) the_content();
    else the_excerpt();

    Thanks again! You rock!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Excerpt title above featured image?’ is closed to new replies.