Forums

[Plugin: Post Teaser] No teaser on homepage (4 posts)

  1. thesambarnes
    Member
    Posted 6 months ago #

    Hi, I was just having a play with your plugin and it looks great, just what I was looking for.

    The only thing Id like to know is if there is a way to stop the teaser from showing on the front page? Its perfect for what I want to happen on archives and categories, but Id like my latest post to show in full on the homepage, with perhaps teasers of the older posts showing underneath - but that would be a nice to have, teasers just not showing in the homepage would be perfect.

    Is there a way to do this?

    Thanks,

    Sam

  2. julial49
    Member
    Posted 6 months ago #

    Yes, there is an easy way and it is independent of the plugin.

    Do you your way around WordPress conditional tags? The one you need is is_home() - see the codex page for details and examples.

    You'll need to insert the tags into the post teaser code.

  3. thesambarnes
    Member
    Posted 6 months ago #

    Hey Julia, thanks for the response. I'm ok with PHP, but could do with some advice on where to place this is_home() line.

  4. weyhan
    Member
    Posted 6 months ago #

    Hi thesambarnes,

    Unfortunately, no easy way because Post Teaser do not yet support configurable teasing depending on which page. There is two ways to do what you want to do. Both ways is kind of a hack at bast but should do what you want it to do.

    1. hack post-teaser.php to remove the is_home() check. Should be easy to locate by searching with your editor.

    2. In your theme, edit your php file for the homepage. If you share a php file for more then one page (e.g. archive page, search page, etc) you will need to add a is_home() page check and if is_home() is true, unhook Post Teaser by using this: remove_filter('the_content', 'pt_process'); Remember to do this before the loop.

    I recommend method #1 if you change your theme quite a lot. #2 if you don't want to edit post-teaser.php every time you upgrade Post Teaser to a new version or you don't care about upgrading Post Teaser.

    If you need more help, contact me with my contact form.

Reply

You must log in to post.

About this Topic