Support » Fixing WordPress » Homepage Permalink Is Wrong

  • Hello

    I’ve just noticed that my homepage permalink seems to be wrong.

    I’m setting the Facebook URL (og:url) to the_permalink(), however it is using the most recent post URL instead of the homepage URL.

    <meta property="og:url" content="<?php echo the_permalink(); ?>"/>


    Any ideas?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @jamesthemonkeh , It seems like all the appropriate og tags are added by Yoast Plugin in your site and you are also adding them by code. So it would be better if you let the Yoast plugin set the og tags.

    However regarding the “the_permalink()” using post URL, that is because in your theme you need to add ‘wp_reset_query();’ function after completion of your post loop. It might solve the problem.


    Thread Starter jamesthemonkeh


    Thanks for your response. You are right that Yoast is doing it for me, I should have realised!

    Incidentally adding wp_reset_query() didn’t fix it (it makes sense that it should), but it is irrelevant.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Homepage Permalink Is Wrong’ is closed to new replies.