Advertisement:

Author Topic: Bender theme and OG tags for Facebook (problem)  (Read 734 times)

oliver244

  • Newbie
  • *
  • Posts: 27
Bender theme and OG tags for Facebook (problem)
« on: February 01, 2017, 06:59:52 pm »
I'm trying to deal with OG tags for my Bender pages (articles like) than have :

-one pic
-one title
-one article
-one link

Except, i have no idea how to deal with Open Graphic tags, as they are supposed to be in head.php... :(

Should i make them dynamic ? (image name is always different)

How to do this properly  ? (I really need Facebook to display my feed right and sponsor ads right...)

Thanks

oliver244

  • Newbie
  • *
  • Posts: 27

Magnettoo

  • Full Member
  • ***
  • Posts: 216
Re: Bender theme and OG tags for Facebook (problem)
« Reply #2 on: February 02, 2017, 11:33:57 am »
Just add this to head just below other meta tags:

Code: [Select]
<meta property="og:url" content="<?php echo osc_item_url(); ?>" />
<meta property="og:type" content="article" />
<meta property="og:title" content="<?php echo osc_item_title() ; ?>" />
<meta property="og:description" content="<?php echo osc_highlight(strip_tags(osc_item_description()), 120) ; ?>" />
<?php if( osc_count_item_resources() > ) { ?>
        <meta property="og:image" content="<?php echo osc_resource_url(); ?>" />
    <?php } else { ?>
        <meta property="og:image" content="<?php echo osc_current_web_theme_url('images/no_photo.jpg') ; ?>" />
<?php ?>

it should do the trick...

pixellegolas

  • Full Member
  • ***
  • Posts: 224
  • zwappa.se
Re: Bender theme and OG tags for Facebook (problem)
« Reply #3 on: February 02, 2017, 12:26:44 pm »
Nice, I was just going to ask about this issue. The problem I have is that I see the ad on facebook but I am missing the city. Do I add info in head to make city appear in facebook or do I need to tweak something in dlvr.it that I am using?

Magnettoo

  • Full Member
  • ***
  • Posts: 216
Re: Bender theme and OG tags for Facebook (problem)
« Reply #4 on: February 02, 2017, 01:04:19 pm »
Where do you want to have the city displayed?

Something like this: Title - City?

If so, you can try this:

change this
<meta property="og:title" content="<?php echo osc_item_title() ; ?>" />

to this
<meta property="og:title" content="<?php echo osc_item_title() ; ?> - <?php echo osc_item_city() ; ?>" />


Regards,
Peter

pixellegolas

  • Full Member
  • ***
  • Posts: 224
  • zwappa.se
Re: Bender theme and OG tags for Facebook (problem)
« Reply #5 on: February 02, 2017, 06:17:16 pm »
Is there a list of all the commands so I can see different ones? I think maybe in item text or something

oliver244

  • Newbie
  • *
  • Posts: 27
Re: Bender theme and OG tags for Facebook (problem)
« Reply #6 on: February 03, 2017, 11:29:12 am »
Personally i installed that plugin and it works perfectly ;)