• Hi Alexander. Thanks for a really great theme. I just ran into a minor issue with the excerpts and featured images issue. I noticed that despite me indicating the maximum number of words for excerpts should be 25 in the theme’s excerpts length settings, you’re theme is still pulling in the entire excerpt and displaying it on all the pages that use the Archives child theme.

    It also pulls the featured image onto the archives pages so that it shows both the photo that I embeded into the post’s article and the featured image I used for it to show in the slider.

    I was wanting to know if there’s a way for it to only pull the max number of words that i specified in the excerpt length settings and to get it to stop pulling the featured image onto the archive pages.

    I would like for it to just show the embedded image that’s in the post and have it be hyperlinked when it shows out on the Archives pages in standard list form along with a “read more” link to the post after the 25 words are shown . My old theme used to do this. Here’s one of the urls I’m talking about from my test site that’s using your typecore theme: https://newzhot.com/category/news/

    Any help you could provide would be greatly appreciated. Thanks….Andre

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author Alexander Agnarson

    (@alxmedia)

    Hi! Thank you.

    that use the Archives child theme

    What files are in this child theme, and does it include content.php? What does that file look like. Make sure it says this for the excerpt part:

    
    <div class="entry excerpt">				
    	<?php the_excerpt(); ?>
    </div><!--/.entry-->
    

    Do you have custom excerpts for every post? If you remove the custom excerpt, it should cut down to the 25 words that the theme setting is set to. Do you use any plugin to show the featured image in the excerpt? Images should never show up in a default excerpt.

    Thread Starter andreflash

    (@andreflash)

    Hi, sorry , no. The theme that’s on my newzhot site is using your Typecore theme, and I just learned that the content.php is what pulls the excerpt with your theme. My old them didn’t have a content.php file.

    I remember going into the archives.php file, and I believe the index.php file in my old theme and being able to stop it from pulling the feature image, and it just naturally only included the text that came before my <!–more–> from within the wp post editor despite how many words I put in the excerpt box.

    It would do that for the home page, the archive pages for each category. However, it was an older theme that was made in 2012 or 2013, and it wasn’t mobile friendly.

    I guess the themes are coded differently these days because your theme isn’t the only one that pulls my entire excerpt and ignores my <!–more-> from inside the wp post editor.

    I kind of have to put all my entire post in the excerpt, or at least most of it because it’s a news source for IMDB, and I also do the Facebook instant articles which I believe pulls from the excerpt in the rss feed. I could be wrong about that though. I’m not entirely sure because I’ve always just included my entire articles in the excerpt box.

    Anyways, if you have any ideas how it could be set up for me to still put my entire article in the excerpt box and have it just pull part of it, it would be greatly appreciated.

    I was able to get the Jetblog plugin with elementor pro to do it, but it will only pull the same list for all the archive pages. Not the actual category posts for the archives. For instance, I could only use it on a “custom” homepage and no where else. It will only pull the latest posts. Not the actual category posts.

    Again, thanks for any help you could provide. I might have to find someone local to dig into the code and see what they can do, or just fall back to my old theme.

    Thread Starter andreflash

    (@andreflash)

    Here was the archive code that my old theme used:

    <?php get_header(); ?>
    <div class=”outer” id=”contentwrap”>
    <?php get_sidebars(‘left’); ?>
    <div class=”postcont”>
    <div id=”content”>

    <?php if (have_posts()) : ?>

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h2 class=”pagetitle”>Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <h2 class=”pagetitle”>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2 class=”pagetitle”>Archive for <?php the_time(‘F jS, Y’); ?></h2>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2 class=”pagetitle”>Archive for <?php the_time(‘F, Y’); ?></h2>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2 class=”pagetitle”>Archive for <?php the_time(‘Y’); ?></h2>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2 class=”pagetitle”>Author Archive</h2>
    <?php /* If this is a paged archive */ } elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?>
    <h2 class=”pagetitle”>Blog Archives</h2>
    <?php } ?>

    <?php while (have_posts()) : the_post(); ?>

    <h2 class=”title”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>

    <p><div <?php post_class() ?>>
    <div class=”postdate”>/images/date.png” />

    Posted by <?php the_author_posts_link() ?> on <?php the_time(‘F jS, Y’) ?> /images/folder.png” /> <?php the_category(‘, ‘) ?> /images/comments.png” /> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?> <?php if (current_user_can(‘edit_post’, $post->ID)) { ?> /images/edit.png” /> <?php edit_post_link(‘Edit’, ”, ”); } ?></div></p>

    <font color=”black”> <div class=”entry”>
    <?php the_content(‘Read more »’); ?>
    </div></font>
    </div>

    <?php endwhile; ?>

    <div class=”navigation”>
    <?php if (function_exists(“pagination”)) {
    pagination($additional_loop->max_num_pages);
    } ?>

    </div>
    <?php else :

    if ( is_category() ) { // If this is a category archive
    printf(“<h2 class=’pagetitle’>Sorry, but there aren’t any posts in the %s category yet.</h2>”, single_cat_title(”,false));
    } else if ( is_date() ) { // If this is a date archive
    echo(“<h2 class=’pagetitle’>Sorry, but there aren’t any posts with this date.</h2>”);
    } else if ( is_author() ) { // If this is a category archive
    $userdata = get_userdatabylogin(get_query_var(‘author_name’));
    printf(“<h2 class=’pagetitle’>Sorry, but there aren’t any posts by %s yet.</h2>”, $userdata->display_name);
    } else {
    echo(“<h2 class=’pagetitle’>No posts found.</h2>”);
    }
    get_search_form();

    endif;
    ?>

    </div>
    </div>

    <?php get_sidebars(‘right’); ?>
    </div>
    <?php get_footer(); ?>

    Here is the Index.php file it used:

    <?php get_header(); ?>
    <div class=”outer” id=”contentwrap”>
    <?php get_sidebars(‘left’); ?>
    <div class=”postcont”>
    <div id=”content”>
    <?php if(is_home()) { include (TEMPLATEPATH . ‘/featured.php’); } ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <h2 class=”title”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>

    <p><div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
    <div class=”postdate”>/images/date.png” />

    Posted by <?php the_author_posts_link() ?> on <?php the_time(‘Y-m-d g:iA’) ?> /images/folder.png” /> <?php the_category(‘, ‘) ?> /images/comments.png” /> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?> </div></p>

    <font color=”black”> <div class=”entry”>
    <?php the_content(‘Read more »’); ?>
    </div></font>
    </div><!–/post-<?php the_ID(); ?>–>

    <?php endwhile; ?>
    <div class=”navigation”>
    <?php if (function_exists(“pagination”)) {
    pagination($additional_loop->max_num_pages);
    } ?>
    </div>
    <?php else : ?>
    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
    <?php get_search_form(); ?>

    <?php endif; ?>
    </div>
    </div>

    <?php get_sidebars(‘right’); ?>
    </div>
    <?php get_footer(); ?>

    Thread Starter andreflash

    (@andreflash)

    Hi, Alexander. I tried to post some code of what my old theme files looked like, but WordPress held it for moderation for some reason. Hopefully, they will approve it soon.

    Thread Starter andreflash

    (@andreflash)

    Hi Alexander, I figured out what was wrong. Is there any way I can get your theme to pull from the full content instead of the excerpt?

    Whenever themes pull from the full content, it doesn’t ignore my <!–more–> tag and only displays the content before the <!–more–> tag on the archive pages. Thanks and sorry for all the confusion…..Andre Braddox

    Theme Author Alexander Agnarson

    (@alxmedia)

    Try changing this:

    
    <?php the_excerpt(); ?>
    

    To this:

    
    <?php the_content(); ?>
    

    Where you want to show the content instead. Preferably edit this with a child theme.

    Thread Starter andreflash

    (@andreflash)

    Hi Alexander,

    Thanks for the response. I actually had tried that, but it didn’t work. It might work with a child theme as you suggest, but I don’t have much experience working with those.

    Anyways, it’s ok though. I figured out that the problem is that I always wrote custom excerpts, and your theme only carries out the number of words if the custom except is left blank. When it ‘s left blank, it works fine. I was able to find an excerpt plugin that will ignore my previous custom excerpts and just put the number of words that I specify.

    But ultimately, I just decided to disable the excerpts in your theme, and just have it display the headlines on the archive pages, and that’s been working great. I still ranks the same in Google. So, everything’s good.

    Again, I applaud you for your great Typecore theme. I love it, especially on the mobile phones. It loads up fast and everything. It truly is a premium theme for free. I actually would have paid for this theme if I had to. I also like how I can just change the colors to bright with a click of a button. It’s running on my main site ontheflix.com . You can check it out if you want.

    Also, I don’t know if you can do this, but in the future, can you make it to where the excerpt will show the amount of words regardless of custom excerpts like the plugin does? I’m just curious because I like to avoid using extra plugins if I can. Thanks again….Andre

    Oh, I almost forgot. I meant to ask you about the sidebars. I was curious is there a way to switch the main sidebar to show up on the right and have the secondary sidebar show up on the left on all pages and posts? Thanks

    • This reply was modified 5 years, 1 month ago by andreflash.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured Image And Excerpt Issue For Archive Pages Issue’ is closed to new replies.