• Resolved cecowe

    (@cecowe)


    Hello, I’m looking for a way to show Meta Title on frontend as a shortcode. I’ve tried with the same thing with Product Title while doing this correction in functions.php:
    <?php
    function page_title_sc( ){
    return get_the_title();
    }
    add_shortcode( ‘page_title’, ‘page_title_sc’ );

    It works very well. But I’m willing to show the Meta Title instead.
    Thank you!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support amboutwe

    (@amboutwe)

    The meta title contains information that you wouldn’t typically output on the page. Things like your site name and the pagination details. This works by using template variables that are replaced on the fly. As such, there is not a simple way to grab the meta title.

    That said, you or your developer can modify the code to fit your needs. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes.

    We recommend checking out Code Poet, WordPress Jobs, or WordPress Professional Network for development & consultancy.

    Our code is documented in GitHub: https://github.com/Yoast/wordpress-seo

    Plugin Support Jerlyn

    (@jerparx)

    Closed. No further questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Meta Title in Frontend’ is closed to new replies.