ThemeShaper Forums » Thematic

[closed]

Full posts on search returns?

(5 posts)
  • Started 3 years ago by MarkCorder
  • Latest reply from MarkCorder
  • This topic is resolved
  1. I've used the method described here in the forums to have Categories, Tags & Archive pages return full-posts instead of excerpts (through the functions.php file) - and it works great. (It's more useful than harmful on my site.)

    However, I can't seem to find or puzzle-out a recipe for making the Search Results display full-posts too...

    ... anybody?

    Posted 3 years ago #
  2. it is the same. you just need the right conditional tag
    http://codex.wordpress.org/Conditional_Tags

    see

    http://forums.themeshaper.com/topic/full-posts-on-category-pages#post-8747

    and instead of is_category use is_search

    Posted 3 years ago #
  3. Well, what I have in my functions.php file is this:

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

    If I add the same chunk of code to the file but use is_search instead, it bombs because it can't use that variable twice. How can I add more than one condition to the IF statement - or could I just change the variable $content to a different name?

    Thanks for your patience...

    Posted 3 years ago #
  4. you could use if/else statements:
    http://www.php.net/manual/en/control-structures.elseif.php

    or since you want full content on is_archive() AND is_search() you need logical operators:
    http://php.net/manual/en/language.operators.logical.php

    function childtheme_content($content) {
    if (is_archive() || is_search()) {
    $content= 'full';}
    return $content;
    }
    
    add_filter('thematic_content', 'childtheme_content');

    the double pipes stand for OR

    Posted 3 years ago #
  5. Thanks, Helga!

    I had tried that but got a typo in it (dropped a bracket...)

    My helmet's off to you.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.