WordPress.org

Ready to get started?Download WordPress

Forums

Only print on post page (1 post)

  1. shidouhikari
    Member
    Posted 5 years ago #

    Hello guys.

    I'm willing to develop a plugin but I can't find a way to do what I need.

    The plugin will have a shortcode added to a post. I need to find a way to, inside of the plugin code, verify where the post is being shown: if it's on the home page, a category page, an archive page... or the post/page page (single.php or page.php).

    If it's not on the post page (any page where more-link will be present if it is used on the post), the plugin will print nothing. Only if it's on the post/page page (the whole text is present and we have the #more-xxx flag) the plugin will print its content.

    If the shortcode is used after more-link it's easy, but if it appear before more-link it will print its content everywhere, and that's not what I want.

    Any idea on how to implement that?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.