How to determine if $content has a <!--more--> tag? (1 post)

  1. miCRoSCoPiC_eaRthLinG
    Posted 8 years ago #

    Hey folks,
    I'm trying to determine if the post is shown in excerpt mode (with a <!--more--> tag or the whole of it is being shown at once. I require this for a plug-in which will insert a piece of code only in full-post mode and not in the excerpt mode.

    I've added a filter hook to 'the_content', and tried analyzing the contents of the variable, $content searching for the term <!--more-->. But I guess, WordPress parses this tag, even before it reaches the plug-in hook..

    What is the best possible way of determining this?

    Second question.. is there a filter hook, that'll apply my plug-ins output ONLY to PAGES and NOT POSTS and vice-versa?


Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 8 years ago by miCRoSCoPiC_eaRthLinG
  • This topic is not resolved
  • WordPress version: 2.5.1