• Hi.

    I want to add some content under posts in the page, but only under those whose entire content is shown.
    However, the the_content gets called for excerpts too.

    Is there a way to change the content only of posts whose all content is visible?

    Thanks in advance,
    Tal.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    What theme are you using and what is your site’s URL? It would also help if you could elaborate further on what exactly it is you are trying to accomplish.

    Thanks!

    Thread Starter talikag

    (@talikag)

    Hi.

    I’m trying to put recommendations (“You might also like…”) under the posts.

    However, I do not want the recommendations to show up if you have a “Read the rest of this entry…” at the bottom of the post.

    I already managed to do this for the default theme of WordPress (by simply using REGEX to find out whether or not the content of the post contains something that looks like ‘a href=”…” class=”read more”‘ in it).

    However, I want the plugin to work in any theme, not just the default one, so I wonder if there’s a generic way to edit the content only to the posts in the page without a “Read more…” link at their bottom

    Thanks!
    Tal.

    I want the plugin to work in any theme

    As far as I know, that is not possible without editing WP core files, and I would not recommend that at all.
    What I would suggest instead is a content filter or a conditional if statement in your index.php file, but that would only work on a per-theme basis, not globally.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add content only to non-excerpt posts’ is closed to new replies.