Yoast SEO plugin question

  • Ricardo

    #1598

    The plugin says I need this code in my header file:

    <title><?php wp_title(''); ?></title>

    But my code (in the Graphene theme) looks like this:

    <title><?php graphene_title(); ?></title>

    Would this matter, or should (can) I change this?

    Admin

    Syahir Hakim

    #16429

    The theme added an additional layer of customisability for the site’s title. You can see the function definition for the graphene_title() function in the functions.php file.

    I am not sure how the Yoast SEO plugin would use the wp_title() function, but my guest would be that it somehow attaches a filter to that function which modifies the site’s title based on the page.

    The theme uses the wp_title() function as well for generating the titles of all pages except the front page. You can try using the plugin first without changing anything, and see how it works out.

    Otherwise, you can simply override the graphene_title() function by placing this code in your child theme’s functions.php file:

    <?php
    function graphene_title(){
    wp_title( '' );
    }
    ?>

    Ricardo

    #16430

    Thanks Syahir, I’m going to add it to my child theme and see how that works out 🙂

    Admin

    Syahir Hakim

    #16431

    Be cautious when using the plugin though. From my tests on my server, it adds about 0.7s to the Time to First Byte of the site. Make sure you test the performance of the site before and after using the plugin.

    Ricardo

    #16432

    Interesting, I am going to test this tonight. I am really satisfied with the plugin atm 🙂

    Ricardo

    #16433

    I won’t recommend using this code. My social media icons stopped working because of it 😉

    <?php
    function graphene_title(){
    wp_title( '' );
    }
    ?>

    What is the best way to test your theme’s speed? Are the online speed testers accurate?

    Admin

    Syahir Hakim

    #16434

    Hah..that’s weird..that function has nothing to do with social media icons..

    I used WebPageTest to test a site’s speed. It’s the same service Google uses for its Pagespeed Online comparison test. Note that your site’s speed depends on a lot of factors, and not just the theme.

    Ricardo

    #16435

    Yeah, really weird! It interfered with my social media plugin, but also with my code to view my twitter followers (the standard twitter code, which I will remove after the Graphene update because it should be integrated in the widget by then).

    I just want to test the speed with and without the SEO plugin 😉

    Update:

    Document Complete (with plugin): 54.557 sec

    Document Complete (without plugin): 53.958 sec

Viewing 8 posts - 1 through 8 (of 8 total)

  • You must be logged in to reply to this topic.