Viewing 7 replies - 1 through 7 (of 7 total)
  • @johnny Bravo,
    You have not added “og:image” property same like “og:title”.
    Please check and correct meta code for image share.

    thanks.

    Hello @johnny Bravo,

    In your <head> tag the og:image is missing, if you check with the sharing debugger from facebook, it says:

    The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.

    https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fartbyherbie.com%2F4999%2Framadan-eight-health-benefits-from-fasting-which-may-shock-surprise-or-stimulate-you%2F

    Since you are not specifying explicitly it uses an image from your page.

    Add that tag manually or consider using a plugin for managing your social tags, like Yoast SEO.

    I hope this answers your question.

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    guys, my header.php file is as follows:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <link rel="icon" href="<?php bloginfo('siteurl'); ?>/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" type="image/x-icon" />
    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/iestyle.css" />
    <![endif]-->
    <style type="text/css" media="screen">
    
    <?php
    global $post;
    $current_page_id = $post->ID;
    // Checks to see whether it needs a sidebar or not
    if ( empty($withcomments) && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
    <?php } else { /* No sidebar */?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    <?php } ?>
    <?php if ( $current_page_id == 2748 ){?>
    	#menu-item-2757 a {
    		background: url(http://www.artbyherbie.com/wp-content/themes/indezinerpaperwall/images/menu_link_bg.gif) repeat-x center;
    		color: #64431E;
    	}
    <?php } ?>
    </style>
    
    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <meta property="og:title" content="<?php the_title(); ?>"/>
    <meta property="og:type" content="<?php if (is_singular()) { echo "article"; } else { echo "website";} ?>"/>
    
    <!-- Put the following javascript before the closing </head> tag. -->
    <script type="text/javascript">
      (function() {
        var cx = '017502216997493018940:WMX205779490';
        var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
        gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//www.google.com/cse/cse.js?cx=' + cx;
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
      })();
    </script>
    
    <?php if (have_posts()):while(have_posts()):the_post(); endwhile; endif;?>
    <?php wp_head(); ?>
    <script src='https://www.google.com/recaptcha/api.js'></script>
    </head>
    <body <?php body_class(); ?>>
    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: '157766117692061', status: true, cookie: true,
                 xfbml: true});
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    <div id="main_container">
    
    <div id="header" role="banner">
    
    	       	<div class="logo">
    
                </div>
    
    </div>
    
    <div class="center_content">
    	<div class="center_content_top">
        	<div class="center_content_bottom">
    
    		<?php
    		function do_the_menu (){
    			wp_page_menu('show_home=1&exclude=6,8, 10, 12, 14, 16, 32, 73, 75, 385, 389, 392, 398, 400, 404, 407, 509, 620, 651, 747, 765, 1037, 1038, 1039, 1040, 1112, 1644, 1826, 2544&menu_class=menu');
    		}
    		//first check if wp_nav_menu has been declared
    		if (function_exists('wp_nav_menu')){
    			//if it has been declared then use it
    			wp_nav_menu( array( 'sort_column' => 'menu_order',
    								'theme_location' => 'primary',
    								'menu' => 'main',
    								'menu_class' => 'sf-menu',
    								'fallback_cb' => 'do_the_menu',
    								'container_class' => 'menu'
    							  )
    						);
    		}else{
    			//if wp_nav_menu doesnt exist we use wp_page_menu
    			do_the_menu();
    		}
    		?>

    the last time i edited this was over 18 months ago so can’t remember the facebook tags/code i added or removed, where exactly is the og:image tag supposed to be?

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    sorry for posting twice, my bad

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    FYI, my functions.php file:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    automatic_feed_links();
    if ( function_exists('register_sidebar') ) {
    	register_sidebar(array(
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h2 class="widgettitle">',
    		'after_title' => '</h2>',
    	));
    }
    /** @ignore */
    
    function bloglow_get_breadcrumb_navigation() {
    $delimiter = '&raquo;';
    $home = get_bloginfo('name');
    $before = '<span>';
    $after = '</span>';
    echo '<div id="breadcrumb"><!-- Bloglow breadcrumb navigation without a plugin v1.0 - http://bloglow.com/plugins/display-wordpress-breadcrumb-navigation-without-a-plugin/ -->';
    global $post;
    $homeLink = get_bloginfo('url');
    echo '<a href="' . $homeLink . '">' . $home . '</a> ' . $delimiter . ' ';
    if ( is_category() ) {
    global $wp_query;
    $cat_obj = $wp_query->get_queried_object();
    $thisCat = $cat_obj->term_id;
    $thisCat = get_category($thisCat);
    $parentCat = get_category($thisCat->parent);
    if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
    echo $before . 'Archive by category "' . single_cat_title('', false) . '"' . $after;
    } elseif ( is_day() ) {
    echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
    echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
    echo $before . 'Archive by date "' . get_the_time('d') . '"' . $after;
    } elseif ( is_month() ) {
    echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
    echo $before . 'Archive by month "' . get_the_time('F') . '"' . $after;
    } elseif ( is_year() ) {
    echo $before . 'Archive by year "' . get_the_time('Y') . '"' . $after;
    } elseif ( is_single() && !is_attachment() ) {
    if ( get_post_type() != 'post' ) {
    $post_type = get_post_type_object(get_post_type());
    $slug = $post_type->rewrite;
    echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a>' . $delimiter . ' ';
    echo $before . get_the_title() . $after;
    } else {
    $cat = get_the_category(); $cat = $cat[0];
    echo ' ' . get_category_parents($cat, TRUE, ' ' . $delimiter . ' ') . ' ';
    echo $before . 'You&apos;re currently reading "' . get_the_title() . '"' . $after;
    }
    } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
    $post_type = get_post_type_object(get_post_type());
    echo $before . $post_type->labels->singular_name . $after;
    } elseif ( is_attachment() ) {
    $parent_id  = $post->post_parent;
    $breadcrumbs = array();
    while ($parent_id) {
    $page = get_page($parent_id);
    $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
    $parent_id    = $page->post_parent;
    }
    $breadcrumbs = array_reverse($breadcrumbs);
    foreach ($breadcrumbs as $crumb) echo ' ' . $crumb . ' ' . $delimiter . ' ';
    echo $before . 'You&apos;re currently viewing "' . get_the_title() . '"' . $after;
    } elseif ( is_page() && !$post->post_parent ) {
    echo $before . 'You&apos;re currently reading "' . get_the_title() . '"' . $after;
    } elseif ( is_page() && $post->post_parent ) {
    $parent_id  = $post->post_parent;
    $breadcrumbs = array();
    while ($parent_id) {
    $page = get_page($parent_id);
    $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
    $parent_id    = $page->post_parent;
    }
    $breadcrumbs = array_reverse($breadcrumbs);
    foreach ($breadcrumbs as $crumb) echo ' ' . $crumb . ' ' . $delimiter . ' ';
    echo $before . 'You&apos;re currently reading "' . get_the_title() . '"' . $after;
    } elseif ( is_search() ) {
    echo $before . 'Search results for "' . get_search_query() . '"' . $after;
    } elseif ( is_tag() ) {
    echo $before . 'Archive by tag "' . single_tag_title('', false) . '"' . $after;
    } elseif ( is_author() ) {
    global $author;
    $userdata = get_userdata($author);
    echo $before . 'Articles posted by "' . $userdata->display_name . '"' . $after;
    } elseif ( is_404() ) {
    echo $before . 'You got it "' . 'Error 404 not Found' . '"&nbsp;' . $after;
    }
    if ( get_query_var('paged') ) {
    if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
    echo ('Page') . ' ' . get_query_var('paged');
    if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
    }
    echo '</div><!-- / Bloglow breadcrumb navigation without a plugin -->';
    }
    
    function kubrick_head() {
    	$head = "<style type='text/css'>\n<!--";
    	$output = '';
    	if ( kubrick_header_image() ) {
    		$url =  kubrick_header_image_url() ;
    		$output .= "#header { background: url('$url') no-repeat bottom center; }\n";
    	}
    	if ( false !== ( $color = kubrick_header_color() ) ) {
    		$output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
    	}
    	if ( false !== ( $display = kubrick_header_display() ) ) {
    		$output .= "#headerimg { display: $display }\n";
    	}
    	$foot = "--></style>\n";
    	if ( '' != $output )
    		echo $head . $output . $foot;
    }
    
    add_action('wp_head', 'kubrick_head');
    
    add_action( 'after_setup_theme', 'setup' );
    function setup() {
    }
    
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 150, 100, false );
    
    // Registering Menus For Theme
    
    add_action( 'init', 'register_my_menus' );
    
    function register_my_menus() {
    	register_nav_menus(
    		array(
    			'main-nav-menu' => __( 'Main Navigation Menu' ),
    			'footer-menu' => __( 'Footer Menu' )
    		)
    	);
    }
    
    function kubrick_header_image() {
    	return apply_filters('kubrick_header_image', get_option('kubrick_header_image'));
    }
    
    function kubrick_upper_color() {
    	if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
    		parse_str(substr($url, strpos($url, '?') + 1), $q);
    		return $q['upper'];
    	} else
    		return '69aee7';
    }
    
    function kubrick_lower_color() {
    	if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
    		parse_str(substr($url, strpos($url, '?') + 1), $q);
    		return $q['lower'];
    	} else
    		return '4180b6';
    }
    
    function kubrick_header_image_url() {
    	if ( $image = kubrick_header_image() )
    		$url = get_template_directory_uri() . '/images/' . $image;
    	else
    		$url = get_template_directory_uri() . '/images/kubrickheader.jpg';
    
    	return $url;
    }
    
    function kubrick_header_color() {
    	return apply_filters('kubrick_header_color', get_option('kubrick_header_color'));
    }
    
    function kubrick_header_color_string() {
    	$color = kubrick_header_color();
    	if ( false === $color )
    		return 'white';
    
    	return $color;
    }
    
    function kubrick_header_display() {
    	return apply_filters('kubrick_header_display', get_option('kubrick_header_display'));
    }
    
    function kubrick_header_display_string() {
    	$display = kubrick_header_display();
    	return $display ? $display : 'inline';
    }
    
    add_action('admin_menu', 'kubrick_add_theme_page');
    
    function kubrick_add_theme_page() {
    	if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {
    		if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) {
    			check_admin_referer('kubrick-header');
    			if ( isset($_REQUEST['njform']) ) {
    				if ( isset($_REQUEST['defaults']) ) {
    					delete_option('kubrick_header_image');
    					delete_option('kubrick_header_color');
    					delete_option('kubrick_header_display');
    				} else {
    					if ( '' == $_REQUEST['njfontcolor'] )
    						delete_option('kubrick_header_color');
    					else {
    						$fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']);
    						update_option('kubrick_header_color', $fontcolor);
    					}
    					if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) {
    						$uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0];
    						$lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0];
    						update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc");
    					}
    
    					if ( isset($_REQUEST['toggledisplay']) ) {
    						if ( false === get_option('kubrick_header_display') )
    							update_option('kubrick_header_display', 'none');
    						else
    							delete_option('kubrick_header_display');
    					}
    				}
    			} else {
    
    				if ( isset($_REQUEST['headerimage']) ) {
    					check_admin_referer('kubrick-header');
    					if ( '' == $_REQUEST['headerimage'] )
    						delete_option('kubrick_header_image');
    					else {
    						$headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']);
    						update_option('kubrick_header_image', $headerimage);
    					}
    				}
    
    				if ( isset($_REQUEST['fontcolor']) ) {
    					check_admin_referer('kubrick-header');
    					if ( '' == $_REQUEST['fontcolor'] )
    						delete_option('kubrick_header_color');
    					else {
    						$fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']);
    						update_option('kubrick_header_color', $fontcolor);
    					}
    				}
    
    				if ( isset($_REQUEST['fontdisplay']) ) {
    					check_admin_referer('kubrick-header');
    					if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] )
    						delete_option('kubrick_header_display');
    					else
    						update_option('kubrick_header_display', 'none');
    				}
    			}
    			//print_r($_REQUEST);
    			wp_redirect("themes.php?page=functions.php&saved=true");
    			die;
    		}
    		add_action('admin_head', 'kubrick_theme_page_head');
    	}
    	add_theme_page(__('Custom Header'), __('Custom Header'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page');
    }
    
    function kubrick_theme_page_head() {
    ?>
    <script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script>
    <script type='text/javascript'>
    // <![CDATA[
    	function pickColor(color) {
    		ColorPicker_targetInput.value = color;
    		kUpdate(ColorPicker_targetInput.id);
    	}
    	function PopupWindow_populate(contents) {
    		contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" class="button-secondary" value="<?php esc_attr_e('Close Color Picker'); ?>" onclick="cp.hidePopup(\'prettyplease\')"></input></p>';
    		this.contents = contents;
    		this.populated = false;
    	}
    	function PopupWindow_hidePopup(magicword) {
    		if ( magicword != 'prettyplease' )
    			return false;
    		if (this.divName != null) {
    			if (this.use_gebi) {
    				document.getElementById(this.divName).style.visibility = "hidden";
    			}
    			else if (this.use_css) {
    				document.all[this.divName].style.visibility = "hidden";
    			}
    			else if (this.use_layers) {
    				document.layers[this.divName].visibility = "hidden";
    			}
    		}
    		else {
    			if (this.popupWindow && !this.popupWindow.closed) {
    				this.popupWindow.close();
    				this.popupWindow = null;
    			}
    		}
    		return false;
    	}
    	function colorSelect(t,p) {
    		if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" )
    			cp.hidePopup('prettyplease');
    		else {
    			cp.p = p;
    			cp.select(t,p);
    		}
    	}
    	function PopupWindow_setSize(width,height) {
    		this.width = 162;
    		this.height = 210;
    	}
    
    	var cp = new ColorPicker();
    	function advUpdate(val, obj) {
    		document.getElementById(obj).value = val;
    		kUpdate(obj);
    	}
    	function kUpdate(oid) {
    		if ( 'uppercolor' == oid || 'lowercolor' == oid ) {
    			uc = document.getElementById('uppercolor').value.replace('#', '');
    			lc = document.getElementById('lowercolor').value.replace('#', '');
    			hi = document.getElementById('headerimage');
    			hi.value = 'header-img.php?upper='+uc+'&lower='+lc;
    			document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat';
    			document.getElementById('advuppercolor').value = '#'+uc;
    			document.getElementById('advlowercolor').value = '#'+lc;
    		}
    		if ( 'fontcolor' == oid ) {
    			document.getElementById('header').style.color = document.getElementById('fontcolor').value;
    			document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value;
    		}
    		if ( 'fontdisplay' == oid ) {
    			document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
    		}
    	}
    	function toggleDisplay() {
    		td = document.getElementById('fontdisplay');
    		td.value = ( td.value == 'none' ) ? 'inline' : 'none';
    		kUpdate('fontdisplay');
    	}
    	function toggleAdvanced() {
    		a = document.getElementById('jsAdvanced');
    		if ( a.style.display == 'none' )
    			a.style.display = 'block';
    		else
    			a.style.display = 'none';
    	}
    	function kDefaults() {
    		document.getElementById('headerimage').value = '';
    		document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7';
    		document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6';
    		document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/kubrickheader.jpg") center no-repeat';
    		document.getElementById('header').style.color = '#FFFFFF';
    		document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '';
    		document.getElementById('fontdisplay').value = 'inline';
    		document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
    	}
    	function kRevert() {
    		document.getElementById('headerimage').value = '<?php echo esc_js(kubrick_header_image()); ?>';
    		document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo esc_js(kubrick_upper_color()); ?>';
    		document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo esc_js(kubrick_lower_color()); ?>';
    		document.getElementById('header').style.background = 'url("<?php echo esc_js(kubrick_header_image_url()); ?>") center no-repeat';
    		document.getElementById('header').style.color = '';
    		document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo esc_js(kubrick_header_color_string()); ?>';
    		document.getElementById('fontdisplay').value = '<?php echo esc_js(kubrick_header_display_string()); ?>';
    		document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
    	}
    	function kInit() {
    		document.getElementById('jsForm').style.display = 'block';
    		document.getElementById('nonJsForm').style.display = 'none';
    	}
    	addLoadEvent(kInit);
    // ]]>
    </script>
    <style type='text/css'>
    	#headwrap {
    		text-align: center;
    	}
    	#kubrick-header {
    		font-size: 80%;
    	}
    	#kubrick-header .hibrowser {
    		width: 780px;
    		height: 260px;
    		overflow: scroll;
    	}
    	#kubrick-header #hitarget {
    		display: none;
    	}
    	#kubrick-header #header h1 {
    		font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
    		font-weight: bold;
    		font-size: 4em;
    		text-align: center;
    		padding-top: 70px;
    		margin: 0;
    	}
    
    	#kubrick-header #header .description {
    		font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
    		font-size: 1.2em;
    		text-align: center;
    	}
    	#kubrick-header #header {
    		text-decoration: none;
    		color: <?php echo kubrick_header_color_string(); ?>;
    		padding: 0;
    		margin: 0;
    		height: 200px;
    		text-align: center;
    		background: url('<?php echo kubrick_header_image_url(); ?>') center no-repeat;
    	}
    	#kubrick-header #headerimg {
    		margin: 0;
    		height: 200px;
    		width: 100%;
    		display: <?php echo kubrick_header_display_string(); ?>;
    	}
    	#jsForm {
    		display: none;
    		text-align: center;
    	}
    	#jsForm input.submit, #jsForm input.button, #jsAdvanced input.button {
    		padding: 0px;
    		margin: 0px;
    	}
    	#advanced {
    		text-align: center;
    		width: 620px;
    	}
    	html>body #advanced {
    		text-align: center;
    		position: relative;
    		left: 50%;
    		margin-left: -380px;
    	}
    	#jsAdvanced {
    		text-align: right;
    	}
    	#nonJsForm {
    		position: relative;
    		text-align: left;
    		margin-left: -370px;
    		left: 50%;
    	}
    	#nonJsForm label {
    		padding-top: 6px;
    		padding-right: 5px;
    		float: left;
    		width: 100px;
    		text-align: right;
    	}
    	.defbutton {
    		font-weight: bold;
    	}
    	.zerosize {
    		width: 0px;
    		height: 0px;
    		overflow: hidden;
    	}
    	#colorPickerDiv a, #colorPickerDiv a:hover {
    		padding: 1px;
    		text-decoration: none;
    		border-bottom: 0px;
    	}
    </style>
    <?php
    }
    
    function kubrick_theme_page() {
    	if ( isset( $_REQUEST['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>';
    ?>
    <div class='wrap'>
    	<h2><?php _e('Customize Header'); ?></h2>
    	<div id="kubrick-header">
    		<div id="headwrap">
    			<div id="header">
    				<div id="headerimg">
    					<h1><?php bloginfo('name'); ?></h1>
    					<div class="description"><?php bloginfo('description'); ?></div>
    				</div>
    			</div>
    		</div>
    		<br />
    		<div id="nonJsForm">
    			<form method="post" action="">
    				<?php wp_nonce_field('kubrick-header'); ?>
    				<div class="zerosize"><input type="submit" name="defaultsubmit" value="<?php esc_attr_e('Save'); ?>" /></div>
    					<label for="njfontcolor"><?php _e('Font Color:'); ?></label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo esc_attr(kubrick_header_color()); ?>" /> <?php printf(__('Any CSS color (%s or %s or %s)'), '<code>red</code>', '<code>#FF0000</code>', '<code>rgb(255, 0, 0)</code>'); ?><br />
    					<label for="njuppercolor"><?php _e('Upper Color:'); ?></label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo esc_attr(kubrick_upper_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br />
    				<label for="njlowercolor"><?php _e('Lower Color:'); ?></label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo esc_attr(kubrick_lower_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br />
    				<input type="hidden" name="hi" id="hi" value="<?php echo esc_attr(kubrick_header_image()); ?>" />
    				<input type="submit" name="toggledisplay" id="toggledisplay" value="<?php esc_attr_e('Toggle Text'); ?>" />
    				<input type="submit" name="defaults" value="<?php esc_attr_e('Use Defaults'); ?>" />
    				<input type="submit" class="defbutton" name="submitform" value="&nbsp;&nbsp;<?php esc_attr_e('Save'); ?>&nbsp;&nbsp;" />
    				<input type="hidden" name="action" value="save" />
    				<input type="hidden" name="njform" value="true" />
    			</form>
    		</div>
    		<div id="jsForm">
    			<form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo esc_attr($_SERVER['REQUEST_URI']); ?>">
    				<?php wp_nonce_field('kubrick-header'); ?>
    	<input type="button"  class="button-secondary" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="<?php esc_attr_e('Font Color'); ?>"></input>
    		<input type="button" class="button-secondary" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="<?php esc_attr_e('Upper Color'); ?>"></input>
    		<input type="button" class="button-secondary" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="<?php esc_attr_e('Lower Color'); ?>"></input>
    				<input type="button" class="button-secondary" name="revert" value="<?php esc_attr_e('Revert'); ?>" onclick="kRevert()" />
    				<input type="button" class="button-secondary" value="<?php esc_attr_e('Advanced'); ?>" onclick="toggleAdvanced()" />
    				<input type="hidden" name="action" value="save" />
    				<input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo esc_attr(kubrick_header_display()); ?>" />
    				<input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo esc_attr(kubrick_header_color()); ?>" />
    				<input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo esc_attr(kubrick_upper_color()); ?>" />
    				<input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo esc_attr(kubrick_lower_color()); ?>" />
    				<input type="hidden" name="headerimage" id="headerimage" value="<?php echo esc_attr(kubrick_header_image()); ?>" />
    				<p class="submit"><input type="submit" name="submitform" class="button-primary" value="<?php esc_attr_e('Update Header'); ?>" onclick="cp.hidePopup('prettyplease')" /></p>
    			</form>
    			<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
    			<div id="advanced">
    				<form id="jsAdvanced" style="display:none;" action="">
    					<?php wp_nonce_field('kubrick-header'); ?>
    					<label for="advfontcolor"><?php _e('Font Color (CSS):'); ?> </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo esc_attr(kubrick_header_color()); ?>" /><br />
    					<label for="advuppercolor"><?php _e('Upper Color (HEX):');?> </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo esc_attr(kubrick_upper_color()); ?>" /><br />
    					<label for="advlowercolor"><?php _e('Lower Color (HEX):'); ?> </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo esc_attr(kubrick_lower_color()); ?>" /><br />
    					<input type="button" class="button-secondary" name="default" value="<?php esc_attr_e('Select Default Colors'); ?>" onclick="kDefaults()" /><br />
    					<input type="button" class="button-secondary" onclick="toggleDisplay();return false;" name="pick" id="pick" value="<?php esc_attr_e('Toggle Text Display'); ?>"></input><br />
    				</form>
    			</div>
    		</div>
    	</div>
    </div>
    <?php
    function the_breadcrumb() {
        global $post;
        echo '<ul id="breadcrumbs">';
        if (!is_home()) {
            echo '<li><a href="';
            echo get_option('home');
            echo '">';
            echo 'Home';
            echo '</a></li><li class="separator"> / </li>';
            if (is_category() || is_single()) {
                echo '<li>';
                the_category(' </li><li class="separator"> / </li><li> ');
                if (is_single()) {
                    echo '</li><li class="separator"> / </li><li>';
                    the_title();
                    echo '</li>';
                }
            } elseif (is_page()) {
                if($post->post_parent){
                    $anc = get_post_ancestors( $post->ID );
                    $title = get_the_title();
                    foreach ( $anc as $ancestor ) {
                        $output = '<li><a href="'.get_permalink($ancestor).'" title="'.get_the_title($ancestor).'">'.get_the_title($ancestor).'</a></li> <li class="separator">/</li>';
                    }
                    echo $output;
                    echo '<strong title="'.$title.'"> '.$title.'</strong>';
                } else {
                    echo '<strong> ';
                    echo the_title();
                    echo '</strong>';
                }
            }
        }
        elseif (is_tag()) {single_tag_title();}
        elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';}
        elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';}
        elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';}
        elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';}
        elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
        elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
        echo '</ul>';
    }
    
    /*-----------------------------------------------------------------------------------*/
    
    /* START Breadcrumbs - see http://docs.woothemes.com/document/show-product-categories-in-wooframework-breadcrumbs/
    
    // Add product categories to the "Product" breadcrumb in WooCommerce.
    
    // Get breadcrumbs on product pages that read: Home > Shop > Product category > Product Name*/
    
    /*-----------------------------------------------------------------------------------*/
    
    add_filter( 'woo_breadcrumbs_trail', 'woo_custom_breadcrumbs_trail_add_product_categories', 20 );
    
    function woo_custom_breadcrumbs_trail_add_product_categories ( $trail ) {
    
    if ( ( get_post_type() == 'product' ) && is_singular() ) {
    
    global $post;
    
    $taxonomy = 'product_cat';
    
    $terms = get_the_terms( $post->ID, $taxonomy );
    
    $links = array();
    
    if ( $terms && ! is_wp_error( $terms ) ) {
    
    $count = 0;
    
    foreach ( $terms as $c ) {
    
    $count++;
    
    if ( $count > 1 ) { continue; }
    
    $parents = woo_get_term_parents( $c->term_id, $taxonomy, true, ', ', $c->name, array() );
    
    if ( $parents != '' && ! is_wp_error( $parents ) ) {
    
    $parents_arr = explode( ', ', $parents );
    
    foreach ( $parents_arr as $p ) {
    
    if ( $p != '' ) { $links[] = $p; }
    
    }
    
    }
    
    }
    
    // Add the trail back on to the end.
    
    // $links[] = $trail['trail_end'];
    
    $trail_end = $trail[count( $trail ) - 1];
    
    // Add the new links, and the original trail's end, back into the trail.
    
    array_splice( $trail, 2, count( $trail ) - 1, $links );
    
    $trail['trail_end'] = $trail_end;
    
    }
    
    }
    
    return $trail;
    
    }
    
    // End woo_custom_breadcrumbs_trail_add_product_categories()
    
    /**
    
    * Retrieve term parents with separator.
    
    *
    
    * @param int $id Term ID.
    
    * @param string $taxonomy.
    
    * @param bool $link Optional, default is false. Whether to format with link.
    
    * @param string $separator Optional, default is '/'. How to separate terms.
    
    * @param bool $nicename Optional, default is false. Whether to use nice name for display.
    
    * @param array $visited Optional. Already linked to terms to prevent duplicates.
    
    * @return string
    
    */
    
    if ( ! function_exists( 'woo_get_term_parents' ) ) {
    
    function woo_get_term_parents( $id, $taxonomy, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
    
    $chain = '';
    
    $parent = &get_term( $id, $taxonomy );
    
    if ( is_wp_error( $parent ) )
    
    return $parent;
    
    if ( $nicename ) {
    
    $name = $parent->slug;
    
    } else {
    
    $name = $parent->name;
    
    }
    
    if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
    
    $visited[] = $parent->parent;
    
    $chain .= woo_get_term_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
    
    }
    
    if ( $link ) {
    
    $chain .= '<a href="' . get_term_link( $parent, $taxonomy ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$parent->name.'</a>' . $separator;
    
    } else {
    
    $chain .= $name.$separator;
    
    }
    
    return $chain;
    
    } // End woo_get_term_parents()
    
    }
    
    // Breadcrumbs Finish
    
    /*-----------------------------------------------------------------------------------*/
    
    /* END Breadcrumbs - End woo_custom_breadcrumbs_trail_add_product_categories()
    
    /*-----------------------------------------------------------------------------------*/
    ?>
    add_theme_support( 'woocommerce' );
    <?php } ?>

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    i can’t see any FB OG code, so I think i need to add this to my functions.php? please advise further as i think i may be missing the complete OG code block, not just the og: image tag?

    Hello @johnny Bravo,

    I believe you are better off using a plugin for this. That is going to solve your issue without worrying about coding this for yourself.

    Do you have any particular reason against using a plugin for this task?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured image not showing when sharing post to Facebook’ is closed to new replies.