Results 1 to 8 of 8
Threaded View
-
21st Oct 2011, 09:35 AM #1OPMember
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 } ?>
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 } }
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
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
MySQL insert using PHP Help
By EnCiPh3r in forum Web Development AreaReplies: 9Last Post: 13th Jan 2012, 11:10 PM -
which the code to insert flash player?
By ctoveloz in forum Webmaster DiscussionReplies: 1Last Post: 20th Oct 2011, 07:20 PM -
insert PSD file
By iobit in forum vBulletinReplies: 10Last Post: 9th Aug 2011, 08:38 AM -
Insert Image Code
By warezboy in forum vBulletinReplies: 12Last Post: 9th Jun 2010, 06:16 PM -
Insert Image CODE
By tom247 in forum Web Application/Script SupportReplies: 3Last Post: 9th Jun 2010, 05:04 AM
themaCreator - create posts from...
Version 3.22 released. Open older version (or...