ThemeShaper Forums » Thematic

[closed]

More Tag Not Showing on Category or Archive Pages

(11 posts)
  • Started 4 years ago by ollie
  • Latest reply from ollie
  • This topic is resolved
  1. Hi, I'm setting up my blog using the latest version of Thematic and the 'More' tag works fine on the front page but is replaced with an elipsis in square brackets [...] on the categor and archive pages. The issue is the same whether I use the default theme or my own child theme.

    I've tried using the global more tag code (<?php global $more;?>) and this allows me to toggle between showing or hiding the elipsis but I can't get the "Read More..." link to show.

    This has been frustrating me for a while now so any help would be hugely appreciated.

    Many thanks

    Ollie

    Posted 4 years ago #
  2. I think this is what you're looking for.

    Sticking this in your functions.php will change the more link everywhere.

    //Make new excerpt Link
    function change_excerpt($content) {
    	$content = str_replace('[...]','...',$content); // remove [...], replace with ...
    	$content = strip_tags($content); // remove HTML
    	return $content;
    }
    add_filter('the_excerpt','change_excerpt');
    Posted 4 years ago #
  3. Hi Tarpontech,

    Many thanks for your reply. I've added the code into my functions.php but still no joy unfortunately.

    My site address is http://www.olliemor.com/

    Any chance you could take a look and see if there's something obvious that I'm missing please?

    Thanks again, Ollie

    Posted 4 years ago #
  4. just realized I gave you the wrong function...that was used for a very specific issue...doh!

    Here, this post appears to be the holy grail of what you're looking to do...found it very helpful myself..

    http://forums.themeshaper.com/topic/noob-customize-read-more-quicktaghow#post-8140

    Posted 4 years ago #
  5. Thanks Tarpontech, I'm halfway there now! I've got a 'PageOfPosts' template set up and it has worked on this page and changed the [...] to 'Read More >' but the archive and category pages are still not showing it.

    As they stand presently, the category page only shows an excerpt without the elipsis, is there a way to enable this?

    Posted 4 years ago #
  6. well, don't know as much about it as I think I do, but shooting from the hip, i'm guessing this is going to take adding the "read more" to the end of the excerpt for these pages via a filter either on the loop itself or just on the excerpt. This is going to take digging into the /thematic/library/extensions/content_extensions.php to see how the read more is added on to the full text so that we can recreate it on the thematic excerpt. Until a ninja shows up to just whip out some code on ya...its going to be a little project. Good news is, between that forum link above, and a few forum searches on "excerpt" should turn up the likely suspects you need to fight with.

    Posted 4 years ago #
  7. Cracked it!!! :oD Thanks so much for your help on this Tarpontech, the pointer towards content_extensions.php was just what I needed!

    Here's what I did:

    1. Read through 'content_extensions.php' until I found the '//creates the content' section on line 476. This section specifies how posts should be displayed depending on the page being shown, it can be either 'full' or 'excerpt'. I changed all the page types to 'full' as follows:

    //creates the content
    function thematic_content() {
    
    	if (is_home() || is_front_page()) {
    		$content = 'full';
    	} elseif (is_single()) {
    		$content = 'full';
    	} elseif (is_tag()) {
    		$content = 'full';
    	} elseif (is_search()) {
    		$content = 'full';
    	} elseif (is_category()) {
    		$content = 'full';
    	} elseif (is_author()) {
    		$content = 'full';
    	} elseif (is_archive()) {
    		$content = 'full';
    	}

    I know I could leave some of them as excerpt but I went for the blanket approach to test the theory.

    Now all of my category and archive pages show the post and a 'Read More >' link.

    I also have a 'Page of Posts' page which is based on a custom template that I found. The more tag doesn't work on it by default but can be enabled by adding the following code in before <?php the_content() ?>

    <?php $more = false; ?>

    Thanks again Tarpontech, couldn't have done it without your help!

    Ollie

    Posted 4 years ago #
  8. well...the code-monkey's on here are going to yell at us for doing it that way...

    The problem you face is if/when you upgrade thematic, it's going to break your customization.

    The good news is, if this is all you wanted...i didn't realize...

    I just posted a filter you can cut-n-paste into you childtheme's functions.php to make this happen. Here, revert your changes inside content_extensions.php and use this instead, does the same thing, just future-proofs your theme:

    function childtheme_content($content) {
    if (is_home() || is_front_page()) {
    		$content = 'full';
    	} elseif (is_single()) {
    		$content = 'full';
    	} elseif (is_tag()) {
    		$content = 'full';
    	} elseif (is_search()) {
    		$content = 'full';
    	} elseif (is_category()) {
    		$content = 'full';
    	} elseif (is_author()) {
    		$content = 'full';
    	} elseif (is_archive()) {
    		$content = 'full';
    	}
    return $content;
    }
    
    add_filter('thematic_content', 'childtheme_content');
    Posted 4 years ago #
  9. well...the code-monkey's on here are going to yell at us for doing it that way...

    The problem you face is if/when you upgrade thematic, it's going to break your customization.

    The good news is, if this is all you wanted...i didn't realize...

    I just posted a filter you can cut-n-paste into you childtheme's functions.php to make this happen. Here, revert your changes inside content_extensions.php and use this instead, does the same thing, just future-proofs your theme:

    function childtheme_content($content) {
    if (is_home() || is_front_page()) {
    		$content = 'full';
    	} elseif (is_single()) {
    		$content = 'full';
    	} elseif (is_tag()) {
    		$content = 'full';
    	} elseif (is_search()) {
    		$content = 'full';
    	} elseif (is_category()) {
    		$content = 'full';
    	} elseif (is_author()) {
    		$content = 'full';
    	} elseif (is_archive()) {
    		$content = 'full';
    	}
    return $content;
    }
    
    add_filter('thematic_content', 'childtheme_content');
    Posted 4 years ago #
  10. Hi,

    be careful, the silverback might be right behind you ;)

    You don't need to include all these conditional tags, if you want to switch everything to full content:

    function childtheme_content($content) {
        return 'full';
    }
    
    add_filter('thematic_content', 'childtheme_content');

    Chris

    Posted 4 years ago #
  11. Thanks guys, I've updated my functions.php and reverted content_extensions.php as suggested and all is well! :o)

    Thanks again

    Ollie

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.