WordPress.org

Forums

[resolved] All in one SEO pack - how to display keywords? (9 posts)

  1. eugenealegiojo
    Member
    Posted 5 years ago #

    Hi,

    I have installed All-in-one SEO pack. Now I want to display the home description and keywords to header and footer, respectively. Any guys here have an idea on how to do this? Please help guys.

    Thanks a lot.
    Eugene

  2. stvwlf
    Member
    Posted 5 years ago #

    Those settings add that code to the head section of your page, not to the contents area. That is where search engines look for them. In other words, they are there but not visible within the browser.

    To see for yourself do a View Source in your browser when you are on your home page.

    If you want to add them so they are visible in header and footer you have to create custom code that reads the All in One settings from the database and displays them in the areas you want them displayed.

    It will be easier to just duplicate what you entered in All in One as HTML text in your theme's header.php and footer.php temmplate files.

  3. eugenealegiojo
    Member
    Posted 5 years ago #

    Thanks for the tips stvwlf, it really helped. I've created another function inside the aioseop.class.php that will get the homepage description and keywords, then get the return value and display description to header and keywords to footer.

    Cheers!

  4. stvwlf
    Member
    Posted 5 years ago #

    Hi

    Glad it helped.

    One thing I have to say about your solution is the All in One plugin gets updated every week or two, so putting the solution in the plugin code means its going to get wiped out each time the plugin updates. You might want to create functions for header and footer in your theme's functions.php file, and execute them within the header.php and footer.php files. That will save you from needing to restore your code to the plugin file.

  5. eugenealegiojo
    Member
    Posted 5 years ago #

    Yes, you're right. I almost forgot that issue. I'll try it out. Thanks a lot.

  6. eugenealegiojo
    Member
    Posted 5 years ago #

    Thank you so much stvwlf. It's worked like a charm.
    Link here: http://trxrv.ca/site/

  7. trman
    Member
    Posted 5 years ago #

    I also use All in one SEO and would like to pass the keywords to a RSS feed. Can you tell me the code for the function you placed in your templates function.php file?

    I am able to pass the title to an RSS feed using the built in WP function the_title but have not been able to do so for the keywords.

    Thanks in advance for any help you can give!

  8. spotcream
    Member
    Posted 5 years ago #

    may i ask why you would add the keywords and description to the footer aswell as the header ??

  9. eugenealegiojo
    Member
    Posted 5 years ago #

    trman,

    You can use like this:

    <?php if(function_exists('aiosp_meta')) : ?>
    				<?php $description = stripcslashes(get_post_meta($post->ID, '_aioseop_description', true)); ?>
    				<?php if(!empty($description)) : ?>
    						<div id="text_content">
    							<p> <?php echo $description; ?></p>
    						</div>
    				<?php endif; ?>
    			<?php endif; ?>

    Hope it helps.

    PS.
    spotcream,

    As per required by the client.

Topic Closed

This topic has been closed to new replies.

About this Topic