Tried adding that in the code, still getting a PHP error. I am wondering if the code itself is correctly written since I am not so good at PHP — just beginning to learn now 🙂 I tried to put it in here:
$post_link = get_permalink();
$post_title = get_the_title();
if ($option['position'] == 'left' && ( !is_single() && !is_page()))
if (($source != 'manual') || ($source != 'shortcode'))
$option['position'] = 'above';
if ($option['position'] == 'left'){
$output = '<div id="leftcontainerBox" style="' .$border. $bkcolor. 'position:' .$option['float_position']. '; top:' .$option['bottom_space']. '; left:' .$option['left_space']. ';">';
if ($option['active_buttons']['facebook_like']==true) {
$output .= '
<div class="buttons">
<iframe src="http://www.facebook.com/plugins/like.php?href=' . urlencode($post_link) . '&layout=box_count&show_faces=false&action=like&font=verdana&colorscheme=light" style="border:none; overflow:hidden; width:50px; height:65px;"></iframe>
</div>';
}
Except, I am trying to define a function for the $post_link so if its the FRONT page, it takes the front page URL (since the $post_link variable set to just get_permalink()) is not working (doesn’t like the front page). Any ideas?
my mistake – I stoppped checking the code after the first obvious problem 🙁
there was one semicolon after the if ()
which could have been a problem, and the closing bracket }
after the else
section was missing;
try:
if (is_home() || is_front_page()) { $post_link = get_bloginfo('url'); } else { $post_link = get_permalink(); }
You did end up fixing the code, but as it turns out, I was looking for
esc_url( wp_logout_url( $_SERVER['REQUEST_URI'] ) );
all along, get_bloginfo(‘url’) didn’t work on the like button for some reason (maybe because its set to a static front page). Weird, anyways, the like button works fine now.
I was actually mistaken… I just can’t seem to figure it out:
The like button on tipstosavingmoney.net (at the bottom) doesn’t like the front page (but works fine on single posts). Is this because it’s set to static posts? Is something blocking this button only from working :S.