WordPress.org

Ready to get started?Download WordPress

Forums

get_title() in plugin (3 posts)

  1. chaaban
    Member
    Posted 5 years ago #

    Hello ,

    i'm working on a plugin to get the first word of the title

    i tried : get_title() but that doesnt work since i cant assignt the value to a variable , it will only echo .

    i tried the add_filter but that will mess the title which i dont want .

    any idea ?

    basicaly i need both the content and the title

    its working fine for the content since i'm editing it on the fly but i dont want to edit the title and i wans to use the title ...

    Thanks

  2. chaaban
    Member
    Posted 5 years ago #

    any help ?

  3. haochi
    Member
    Posted 5 years ago #

    Read the doc, it's there: http://codex.wordpress.org/Template_Tags/the_title

    <?php $post_title = the_title("", "", false); ?>

    Also see: the_title_attribute()

Topic Closed

This topic has been closed to new replies.

About this Topic