WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. tprod
    Member
    Posted 4 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.

    Regards

  2. tprod
    Member
    Posted 3 years ago #

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

  3. Daniel Haim
    Member
    Posted 3 years ago #

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

  4. John
    Member
    Posted 3 years ago #

    @tprod: This code should work:

    <?php
    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
    Member
    Posted 3 years ago #

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

    Thanks again.

    Tprod

Topic Closed

This topic has been closed to new replies.

About this Topic