WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Insert All In One SEO Title into the Sidebar (3 posts)

  1. crallin
    Member
    Posted 3 years ago #

    I have been trying various codes to try and get the All In One SEO title into the sidebar for my Add to Any code to work. I have to use a custom url for some of my other pages that change the url. So far, I have tried this:

    $SeoTitle= get_post_meta(2, '_aioseop_title', TRUE);
    if (get_post_meta($post->ID, '_aioseop_title', TRUE) != '') {
    $SeoTitle = get_post_meta($post->ID, '_aioseop_title', TRUE);
    		}
    echo $SeoTitle;

    which doesn't echo anything. I am guessing it doesn't work because it can't access the post meta data in the sidebar. How do i get this working.

    Thanks for your help!!

  2. crallin
    Member
    Posted 3 years ago #

    echo '<div id="featured_agent"><div class="a2a_kit a2a_default_style" >
    				<a class="a2a_dd" href="http://www.addtoany.com/share_save?linkurl=http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"].';linkname=';
    				echo wp_title();
    				echo ' - CABCOT.com">Share</a>
    				<span class="a2a_divider"></span>
    				<a class="a2a_button_facebook"></a>
    				<a class="a2a_button_twitter"></a>
    				<a class="a2a_button_email"></a>
    				<a class="a2a_button_digg"></a>
    				<div style="clear:both"></div></div></div>
    				<script type="text/javascript">
    				var a2a_config = a2a_config || {};
    				a2a_config.linkname = "';
    				echo wp_title();
    				echo ' - CABCOT.com";
    				a2a_config.linkurl = "http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"].'";
    				</script>
    				<script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>';

    Here is what I am currently using; however, the pages with AIOSEO titles don't output the correct title.

  3. crallin
    Member
    Posted 3 years ago #

    Nevermind, I figured it out.

Topic Closed

This topic has been closed to new replies.

About this Topic