[resolved] [Plugin: SEO Ultimate] - Get title in variable PHP (5 posts)

  1. tprod
    Posted 6 years ago #

    Hi everyone,

    I use this fantastic SEO plugin but I want to optimize h1 by retrieving title of each page in a php variable.

    How can I do ? Any ideas ?

    Thanks for your help.


  2. tprod
    Posted 5 years ago #

    In fact you can use a session for that. It's not the better idea but it works.

  3. Daniel Haim
    Posted 5 years ago #

    Have you tried Yoast's new WordPress SEO plugin? http://yoast.com/wordpress-seo-public-beta/

  4. John
    Posted 5 years ago #

    @tprod: This code should work:

    global $seo_ultimate;
    $title_tag = $seo_ultimate->modules['titles']->get_title();
    echo "<h1>$title_tag</h1>";

    @Daniel: Neither SEO Ultimate nor Yoast's plugin offers an automated (i.e. code-free) way to accomplish what tprod is asking about. The code I posted is the easiest way to do it with SEO Ultimate, and you could probably do something similar with Yoast's plugin.

  5. tprod
    Posted 5 years ago #

    Hi John and thanks for your answer. It works like a charm.
    Besides, your update resolve several problems.

    Thanks again.


Topic Closed

This topic has been closed to new replies.

About this Topic