Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4612482
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:24:31+00:00 2026-05-22T01:24:31+00:00

I have a wordpress site with like buttons that are generated for each post

  • 0

I have a wordpress site with like buttons that are generated for each post and given the_permalink as the url. I have set the standard opengraph tags in the header of the template, but then of course the problem is that every single like button will post the same title, description and image etc.

The problem lies in that I can’t set the tags within the loop because the meta tags have to be in the header?

Is there any solution to this problem? I’ve tried a number of plugins but they all seem overly complicated and hard to position properly within the template.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:24:32+00:00Added an answer on May 22, 2026 at 1:24 am

    I suppose you could do one of the following:
    1- Placing the meta tags to the header manually:

    <meta property="fb:admins" content="XXXXXXX"/>
    <meta property="og:site_name" content="Example.com"/>
    <meta property="og:image" content="http://www.example.com/image.png"/>
    <?php if (is_front_page()) : ?>
    <meta property="og:type" content="blog"/>
    <meta property="og:description" content="test test test test"/>
    <meta property="og:title" content="My title"/>
    <meta property="og:url" content="<?php echo get_bloginfo('home'); ?>"/>
    <?php elseif (is_single() || is_page()) : ?>
    <meta property="og:type" content="article"/>
    <meta property="og:title" content="<?php echo trim(wp_title('', false)); ?>"/>
    <meta property="og:url" content="<?php echo get_permalink(); ?>"/>
    <?php elseif (!is_front_page() && !is_single() && !is_page()) : ?>
    <meta property="og:title" content="<?php echo trim(wp_title('', false)); ?>"/>
    <?php endif ?>
    

    Or if you want to use hooks (functions.php):

    add_action('wp_head', 'add_og_meta_tags');
    function add_og_meta_tags() {
    echo '<meta property="fb:admins" content="XXXXXXX"/>
    <meta property="og:site_name" content="Example.com"/>
    <meta property="og:image" content="http://www.example.com/image.png"/>';
    if (is_front_page()) :
    echo '<meta property="og:type" content="blog"/>
    <meta property="og:description" content="test test test test"/>
    <meta property="og:title" content="My title"/>
    <meta property="og:url" content=" '. get_bloginfo('home') . '"/>';
    elseif (is_single() || is_page()) :
    echo '<meta property="og:type" content="article"/>
    <meta property="og:title" content="' . trim(wp_title('', false)) . '"/>
    <meta property="og:url" content="' . get_permalink() .'"/>';
    elseif (!is_front_page() && !is_single() && !is_page()) :
    echo '<meta property="og:title" content="' . trim(wp_title('', false)) .'"/>';
    endif;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Wordpress site that I am currently working on and have set
I have a WordPress site (2.6.2) in which I have set the Home page
I am wordking on a site, made with wordpress, and i like to have
I have a wordpress site with a large number of pages, each page represent
I have a wordpress site that i've been working on that has some pages
The issue is like this....... I have Joomla and WordPress installed on one site
I've noticed that a few Wordpress blogs have query statistics present in their footer
I have a friend who has code like this in his wordpress files: Blockquote
I'm starting a Wordpress Blog that will have adult content on it, so I'll
I have close to 30 wordpress installs that will grow very rapidly to double

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.