WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts by Zemanta
[resolved] Related Posts on Static Homepage (8 posts)

  1. hilmil
    Member
    Posted 7 months ago #

    Hi Silvo,

    I have a new website that just launched and I'm happily using Related Posts. I would like to see them on my Static Home Page and some of my Pages as well as Posts. Is there a code I can place somewhere?

    I'm not very code savvy, but I'm a wiz at copying and pasting :)

    Thanks!
    Hillary

    http://wordpress.org/plugins/related-posts-by-zemanta/

  2. silvoslaf
    Member
    Plugin Author

    Posted 7 months ago #

    Hey Hillary, glad to hear that, since the instructions I have for our users basically require only those skills. :)

    Follow the steps and you should be good to go in no-time! :)

    Go to your WordPress's Dashboard under the tab 'Appearance'-'Editor' and choose your theme in the upper right corner (usually it's called "Twenty Eleven"). Now click on the 'content.php' file, which you can find on the right hand side of your screen. After that, search for the following code in the code editor:

    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>

    Now that you have found this, just add the following code line at the end of it:

    <?php zemanta_related_posts()?>

    So, to sum it up, the whole thing should look like this:

    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>
    		<?php zemanta_related_posts()?>

    Remember to click on the 'Update File' button when you're finished. Visit your blog, refresh the whole page and you should be able to see those related posts over there.

    Did it work? Need any further assistance or do you have any other questions? Let me know — I'll gladly help!

    Take care & have a nice weekend ahead!

    Best,
    Silvo

  3. hilmil
    Member
    Posted 7 months ago #

    Hi Silvo,

    Thanks for this information. I am using Atahualpa for this particular blog's Theme. It's quite flexible but a tremendous challenge when it comes to finding where to place code. If I go to my WP Appearance Editor and select Atahualpa there is no option to edit the content.php. I may have to get some advice from my webmaster unless you or someone else reading this thread knows how to correctly make content.php changes from within Atahualpa's Theme Options.

    Best,
    Hillary

  4. silvoslaf
    Member
    Plugin Author

    Posted 7 months ago #

    Hey Hillary, thanks for your feedback, I immediately checked your theme on the web and since it's free of charge, I installed it on my blog to find the right place for your shortcode. Do the changes I described below and I'm sure this time it'll work!

    Follow the same steps as before, but select the Main Index Template file (index.php) instead of the non-existent content.php file. In it, look for the following code:

    <?php } ?>
    		<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    		<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    		<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    		<?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    		<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    		</div><!-- / Post -->

    Now enter our shortcode just before the footer line of code, so that it should look like this:

    <?php } ?>
    		<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    		<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    		<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    		<?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    		<strong><?php zemanta_related_posts()?></strong>
    		<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    		</div><!-- / Post -->

    After that, hit the 'Update File' button, go to your blog's homepage and refresh it — your related posts should now be where you wanted them. :)

    Let me know how it goes or if you need any further assistance — I'll do my best to help you out!

    Take care & have a nice day!

    Best,
    Silvo

  5. silvoslaf
    Member
    Plugin Author

    Posted 7 months ago #

    Hey Hillary, please accept my apologies, but I made a mistake in my previous reply, so please ignore it completely, in order to avoid any inconvenience. Sorry, my mistake!

    So, the steps once again:

    Follow the same steps as before, but select the Main Index Template file (index.php) instead of the non-existent content.php file. In it, look for the following code:

    <?php } ?>
    		<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    		<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    		<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    		<?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    		<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    		</div><!-- / Post -->

    Now enter our shortcode just before the footer line of code, so that it should look like this:

    <?php } ?>
    		<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    		<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    		<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    		<?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    		<strong><?php zemanta_related_posts()?></strong>
    		<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    		</div><!-- / Post -->

    After that, hit the 'Update File' button, go to your blog's homepage and refresh it — your related posts should now be where you wanted them. :)

    Let me know how it goes or if you need any further assistance — I'll do my best to help you out!

    Take care & have a nice day!

    Best,
    Silvo

  6. silvoslaf
    Member
    Plugin Author

    Posted 7 months ago #

    OK, third time is the charm! :)

    Follow the same steps as before, but select the Main Index Template file (index.php) instead of the non-existent content.php file. In it, look for the following code:

    <?php } ?>
    		<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    		<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    		<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    		<?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    		<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    		</div><!-- / Post -->

    Now enter our shortcode just before the footer line of code, so that it should look like this:

    <?php } ?>
    		<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    		<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    		<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    		<?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    		<?php zemanta_related_posts()?>
    		<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    		</div><!-- / Post -->

    After that, hit the 'Update File' button, go to your blog's homepage and refresh it — your related posts should now be where you wanted them. :)

    Let me know how it goes or if you need any further assistance — I'll do my best to help you out!

    Take care & have a nice day!

    Best,
    Silvo

  7. hilmil
    Member
    Posted 7 months ago #

    Hi Silvo,

    I followed your latest directions by placing your shortcode to my theme's index.php, placing it right before the footer code.

    Yes, the related posts now appear on the static homepage, but unfortunately they also appear in duplicate on all other posts!. Also, in trying to edit the home page related posts, I get an error message to "Please upgrade the plugin to use search".

    I had to remove the shortcode. Thanks anyway Silvo. This just may be something you can feature in your next update. There are certainly other ways for me to feature related posts the static homepage. I can easily create a table.

    Best,
    Hillary

  8. silvoslaf
    Member
    Plugin Author

    Posted 7 months ago #

    Hey Hillary, thanks for your feedback!

    Well, you can remove the duplicated related posts inside your blog posts, if you go to your plugin settings and un-tick the box next to "Auto Insert Related Posts" at the bottom of the page. This way you'll have your related posts both on your home page and inside of your blog posts, without duplicating them.

    As for that error message you get when clicking on that button of ours — I'm afraid the editing is only possible inside the particular blog post, but not from the home page. If you make your changes over there, those (changed/edited) related posts will also be visible on your home page as well. Since it takes you only one click more, I think it's not that big of a deal.

    But we appreciate your feedback and we will certainly try to fix it by the next release! :)

    And let me know what you think or if you have any more questions, since I'll gladly help! Take care!

    Best,
    Silvo

Reply

You must log in to post.

About this Plugin

About this Topic