ThemeShaper Forums » Thematic

[closed]

Show Blog Title Only for Preview

(9 posts)
  • Started 13 years ago by DigitalVideo
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. On my home page, where my recent blog posts are shown, how can I set it up to show only the title of the post and the featured image? As opposed to previewing the first few sentences of the post. I think it looks much more clean without the content preview, but I can't figure out how to implement it... As an example, gizmodo.com , you can see on the right side that the "latest entries" previews have only the title of the post and the image. Thanks for any help!

    Posted 13 years ago #
  2. you're going to have to filter thematic_post

    you can see how it is set up in the content-extensions.php file in the library/extensions folder of thematic.... its in the thematic_content function

    Posted 13 years ago #
  3. Hey, I'm looking at my library/extensions folder but I can't quite figure out how to filter it in my child theme. Any suggestions of where I should look to learn how to do filters? I'm sorry, I've never coded before in my life, so it's slow learning for me.

    Posted 13 years ago #
  4. Okay, I have this code in my functions.php file:

    $full_content = false;
    function childtheme_content($content) {
    if ($full_content) {
    $content= 'full';
    } elseif (is_home() || is_front_page()) {
    $content= 'none';
    } elseif (is_single()) {
    $content = 'full';
    } elseif (is_tag()) {
    $content = 'excerpt';
    } elseif (is_search()) {
    $content = 'none';
    } elseif (is_category('Video')) {
    $content = 'full';
    } elseif (is_author()) {
    $content = 'excerpt';
    } elseif (is_archive()) {
    $content = 'none';
    }
    return $content;
    }
    add_filter('thematic_content', 'childtheme_content');

    I changed content to = 'none' for the front page. This worked, but now the meta looks out of place. How would I get rid of the author, tags, category, etc; and only have the title of the post?

    Posted 13 years ago #
  5. filter the thematic_postheader. if you create a postheader w/o the thematic_postheader_postmeta in there that will get rid of all the date/author meta. you can also filter the thematic_postfooter to get rid of the tags, etc.

    Posted 13 years ago #
  6. So that would look something like:

    function thematic_postheader($postmeta){
    display:none}
    add_filter(thematic_postheader);

    EDIT:
    Nope... I think I'm getting confused between PHP and CSS here? Anyways, not sure what exactly I need to do.

    Posted 13 years ago #
  7. yes you are confusing CSS and PHP if you dont want any postmeta ANYWHERE you could do

    function childtheme_override_postheader_postmeta(){
    //the sound of one hand clapping
    }

    or the equivalent in filters

    function childtheme_postheader_postmeta(){
      $postmeta = '' ; //the sound of one hand clapping
      return $postmeta;
    }
    add_filter('thematic_postheader_postmeta','childtheme_postheader_postmeta');

    btw- for first filter (thematic_content) i dont understand what you are doing with

    if ($full_content) {

    but you don't have to re-write the sections that are NOT different from thematic... such as

    elseif (is_single()) {
    $content = 'full';
    } elseif (is_tag()) {
    $content = 'excerpt';

    it works, but you can delete them and they should still work

    Posted 13 years ago #
  8. I hate to bring this back up, but how would I go about displaying only the first line of a post? Not a certain number of words, but just the top line?

    Posted 13 years ago #
  9. if you want that you probably should write custom excerpts that are exactly 1 sentence... i can't think of how to do that automatically.

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.