Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Ralf Skirr

    (@ralf-skirr)

    Did some research and figured it out myself. ??

    <?php echo get_post_meta($post->ID, ‘_yoast_wpseo_title’, true); ?>

    And for the description it would be:

    <?php echo get_post_meta($post->ID, ‘_yoast_wpseo_metadesc’, true); ?>

    Plugin Contributor joostdevalk

    (@joostdevalk)

    Absolutely true ??

    Thread Starter Ralf Skirr

    (@ralf-skirr)

    Oh, I guess we need to take it a step further.

    I installed the plugin to a wp that already has posts.

    Using the code above it does not output any title for older posts; it only outputs titles for posts that i saved after installing the wordpress seo plugin.

    Is this how it is supposed to work?

    If yes, maybe the code above should be used in some if else statement.

    Something like:
    if there is a yoast seo title display that
    else display wp_title

    Ah, now you can see, I’m not a programmer. Would be nice if anybody could provide the php code.

    Plugin Contributor joostdevalk

    (@joostdevalk)

    Well, you’re hooking into the stored title now, you could also hook into the title function itself, try this:

    echo $wpseo_front->title();

    Thread Starter Ralf Skirr

    (@ralf-skirr)

    When I use it as is, i get the error message:

    Warning: Missing argument 1 for WPSEO_Frontend::title(),

    When i enter something like this:
    <?php echo $wpseo_front->title($postID);?> (random trial of mine)

    It works on single pages, but not on index pages.

    On index pages each entry gets the title of the index page it is displayed on, not the title for the post id of the looped element.

    Plugin Contributor joostdevalk

    (@joostdevalk)

    Why do you want to use this title on those pages too? It just doesn’t make much sense to me I guess ??

    Thread Starter Ralf Skirr

    (@ralf-skirr)

    The idea is to create a custom read more link after excerpts. ??

    Plugin Contributor joostdevalk

    (@joostdevalk)

    to make it work for you i’d have to apply a fix that I don’t really want to as it’d use more memory… Sorry.

    Michael

    (@mbrownwebnetinteractivecom)

    <?php echo get_post_meta($post->ID, ‘_yoast_wpseo_title’, true); ?>
    <?php echo get_post_meta($post->ID, ‘_yoast_wpseo_metadesc’, true); ?>

    Are just what I am looking for !!!

    What would be the PHP code for meta-keywords? =)

    Michael

    (@mbrownwebnetinteractivecom)

    I found the answer on my own ..

    The code I was looking for to pull the meta keywords is ..
    <?php echo get_post_meta($post->ID, ‘_yoast_wpseo_metakeywords’, true); ?>

    Hope this helps someone.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: WordPress SEO] Using SEO Title and Meta Description in wp Loop’ is closed to new replies.