Activity Stream
48,167 MEMBERS
6915 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default Where can I insert this code?

    Hello guys,

    Im trying to make this facebook trick in my blog:
    http://capturingyourmarket.com/socia...facebook-page/

    But dont know where I can add the code below in my theme:

    In your WordPress menu, go to Appearance -> Editor. In the right side you will see a list of the various pages and parts of your WordPress theme. Click on the Header file to open it for editing.
    Between the <head>...</head> tags copy and paste the following code.
    PHP Code: 
    <?php if(is_single()) { ?> <?php   // Featured Image for FB Like $feature_image = get_the_post_thumbnail($post->ID);   // Get image source $doc = new DOMDocument(); $doc->loadHTML($feature_image); $imageTags = $doc->getElementsByTagName('img');   foreach($imageTags as $tag) {         $image_url = $tag->getAttribute('src');     } ?> <link rel="image_src" href="<?php echo $image_url?>" /> <?php ?>
    I know that I need to insert at header.php but my theme is a little different. Im using a theme called "Gallery" (theme by UpThemes) that are working with the Thematic child theme. Can someone help me with that please?

    Another option is to edit a social plugin that I have installed in my blog called Tweet, Like, Google +1 and Share.
    In that plugin file tweet-like-plusone.php I have this code that appears beteween the <head> and </head:

    Code: 
    if(is_single() || is_page()) { 
    ?>
        <meta property="og:type" content="article" />
        <meta property="og:title" content="<?php single_post_title(''); ?> | www.estapessoa.com" />
        <meta property="og:description" content="Se pensas o mesmo, clica em PARTILHAR para colocares no teu mural e mostrar aos teus amigos! Visita a nossa p?gina e clica em GOSTO para ficares a par das frases do momento: http://www.facebook.com/estapessoa" />
        <meta property="og:url" content="<?php the_permalink(); ?>"/>
        <?php if(trim($thumb)!=''){ ?>
            <meta property="og:image" content="<?php echo $thumb; ?>" />
        <?php } ?>
    <?php  } else { ?>
        <meta property="og:type" content="article" />
          <meta property="og:title" content="<?php bloginfo('name'); ?>" />
        <meta property="og:url" content="<?php bloginfo('url'); ?>"/>
        <meta property="og:description" content="Se pensas o mesmo, clica em PARTILHAR para colocares no teu mural e mostrar aos teus amigos! Visita a nossa p?gina e clica em GOSTO para ficares a par das frases do momento: http://www.facebook.com/estapessoa" />
        <?php if(trim($default_img)!=''){ ?>
            <meta property="og:image" content="<?php echo $default_img; ?>" />
        <?php } ?>
    <?php  } 
    
    }
    But dont know where I need to put the code...
    Divvy Reviewed by Divvy on . Where can I insert this code? Hello guys, Im trying to make this facebook trick in my blog: http://capturingyourmarket.com/social-media/customize-your-business-facebook-page/ But dont know where I can add the code below in my theme: I know that I need to insert at header.php but my theme is a little different. Im using a theme called "Gallery" (theme by UpThemes) that are working with the Thematic child theme. Can someone help me with that please? Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    try this:
    Code: 
    if(is_single() || is_page()) { 
    ?>
        <meta property="og:type" content="article" />
        <meta property="og:title" content="<?php single_post_title(''); ?> | www.estapessoa.com" />
        <meta property="og:description" content="Se pensas o mesmo, clica em PARTILHAR para colocares no teu mural e mostrar aos teus amigos! Visita a nossa p?gina e clica em GOSTO para ficares a par das frases do momento: http://www.facebook.com/estapessoa" />
        <meta property="og:url" content="<?php the_permalink(); ?>"/>
        <?php if(trim($thumb)!=''){ ?>
            <meta property="og:image" content="<?php echo $thumb; ?>" />
        <?php } ?>
    <?php  } else { ?>
        <meta property="og:type" content="article" />
          <meta property="og:title" content="<?php bloginfo('name'); ?>" />
        <meta property="og:url" content="<?php bloginfo('url'); ?>"/>
        <meta property="og:description" content="Se pensas o mesmo, clica em PARTILHAR para colocares no teu mural e mostrar aos teus amigos! Visita a nossa p?gina e clica em GOSTO para ficares a par das frases do momento: http://www.facebook.com/estapessoa" />
        <?php if(trim($default_img)!=''){ ?>
            <meta property="og:image" content="<?php echo $default_img; ?>" />
        <?php } ?>
    <?php  } ?>
    <?php if(is_single()) { ?>
    <?php
     
    // Featured Image for FB Like
    $feature_image = get_the_post_thumbnail($post->ID);
     
    // Get image source
    $doc = new DOMDocument();
    $doc->loadHTML($feature_image);
    $imageTags = $doc->getElementsByTagName('img');
     
    foreach($imageTags as $tag) {
            $image_url = $tag->getAttribute('src');
        }
    ?>
    <link rel="image_src" href="<?php echo $image_url; ?>" />
    <?php } ?>

  4.     
    #3
    Member
    Thank you for your reply mate!

    But already found the </head> in the thematic theme and added the code above.
    Is working and grab the image correctly, but the trick didn't work
    Does anyone confirm that? Anyone use or test this trick?

  5.     
    #4
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    check my previous post again, some lines were commented

  6.     
    #5
    Member
    ohh sorry, I will try!

    hmmm gives me an error:
    Parse error: syntax error, unexpected '}' in /home/test123/public_html/wp-content/plugins/only-tweet-like-share-and-google-1/tweet-like-plusone.php on line 357

  7.     
    #6
    Member
    looks like theres an additional '}' which shouldn't be there.
    try to change this:
    <meta property="og:image" content="<?php echo $default_img; ?>" />
    <?php } ?>
    <?php }

    } ?>
    <?php if(is_single()) { ?>
    to this:

    <meta property="og:image" content="<?php echo $default_img; ?>" />
    <?php } ?>
    <?php } ?>
    <?php if(is_single()) { ?>

  8.     
    #7
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    check my post again, was an extra }

  9.     
    #8
    Member
    worst... too many errors like that lol

    EDIT: (final error
    Fatal error: Call to undefined function disp_social_on_optionpage() in /home/pessoa/public_html/wp-content/plugins/only-tweet-like-share-and-google-1/tweet-like-plusone.php on line 234

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MySQL insert using PHP Help
    By EnCiPh3r in forum Web Development Area
    Replies: 9
    Last Post: 13th Jan 2012, 11:10 PM
  2. which the code to insert flash player?
    By ctoveloz in forum Webmaster Discussion
    Replies: 1
    Last Post: 20th Oct 2011, 07:20 PM
  3. insert PSD file
    By iobit in forum vBulletin
    Replies: 10
    Last Post: 9th Aug 2011, 08:38 AM
  4. Insert Image Code
    By warezboy in forum vBulletin
    Replies: 12
    Last Post: 9th Jun 2010, 06:16 PM
  5. Insert Image CODE
    By tom247 in forum Web Application/Script Support
    Replies: 3
    Last Post: 9th Jun 2010, 05:04 AM

Tags for this Thread

BE SOCIAL