• Resolved Brian M.

    (@brimoknight)


    Hello, WordPress! I hope one of you fine people can assist me.

    I want to add content right below my blog posts on the home page of my site.
    XinoGamez.com

    I have seen this before, represented better but the only site I was able to find is this one:Starta-blogg.se This is pretty much what I desire to be able to do.

    Furthermore, the content I want in this area is an embed-able code/thing (hehe sorry – dont know how to better explain) It is currently in the middle footer widget (Paper.li), I would like to place it where I previously mentioned.

    Any help or guidance would be greatly appreciate it. Gracias!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi Xinori. This thread describes the basic process. If you want to display the ads below the posts on the home page, regardless of the number of posts, you would place your sidebar just above the pagination line in index.php, like this:

    <?php endif; ?>
    
       <?php dynamic_sidebar('my-post-ads'); ?>	// insert the ad sidebar
    
    <?php get_template_part('inc/pagination'); ?>

    Let me know if you have any questions.

    Thread Starter Brian M.

    (@brimoknight)

    Hey bdbrown! We meet again! I think I should clarify I am using the old Hueman theme, I found a few things with the new theme update that I didn’t care for, and while some great features were added, others were removed that I was using. I hope this does not disqualify me from assistance.

    I felt I should mention this, as I have a feeling the code above is related to the new theme style. I will however check the thread you linked. ^-^ Thanks!

    Thread Starter Brian M.

    (@brimoknight)

    Hmm, I just took a look and I dont think my theme has sidebar ads. So will wait for your response… If I would have to install the latest theme, sigh that would take some hard consideration. But please let me know if I can proceed with these steps or if its not pertaining to my version.

    Thanks a whole lot! (:

    The only built-in “sidebar ads” in the current version are the Header Ads and Footer Ads sidebars. If these are active then the theme loads them in the header and footer. Other than that you have to manually create the new sidebars to hold your ads. I’m not sure when that feature was added but you create the sidebars under Theme Options > Sidebars. Then you load the widget in the sidebar in Appearance > Widgets. Then you modify index.php to load the sidebar wherever you want to see it.

    Thread Starter Brian M.

    (@brimoknight)

    Thanks a bunch! It worked! So grateful! You mind taking a look at this and seeing if I cluttered it up a bit? I used a piece of code from the thread you linked me to but saw no results. Then, I added the code you initially mentioned above and it worked. Should I remove anything from here?

    <div class="post-list group">
    
    <?php $i = 1;								// initialize the post counter
    echo '<div class="post-row">';				// create the post-row div
    while ( have_posts() ): the_post(); ?>		<!-- while we have posts -->
    	<?php get_template_part('content'); ?>		<!-- display the post -->
    
    	<?php if ($i % 2 == 0) {				// if we've shown 2 posts
    		echo '</div>';						// close this post-row div
    
    		// BEGIN insert my custom widget after 6 posts
    		if ($i % 6== 0) {					// if we've displayed 6 posts
    			echo '<div class="my-ad-widget">';		// create the widget div
    			dynamic_sidebar('sidebar-lowercontent');		// show the widget
    			echo '</div>'; 				 	// close the widget div
    		}
    		// END insert my custom widget
    
        echo '<div class="post-row">';			// create the next post-row div
    	}
    
    	$i++;									// increment the post counter
    endwhile;
    echo '</div>';								// close the trailing post-row div
    ?>
    
    </div><!--/.post-list-->
    		<?php dynamic_sidebar('sidebar-lowercontent'); ?>
    
    			<?php get_template_part('inc/pagination'); ?>
    
    		<?php endif; ?>
    
    	</div><!--/.pad-->

    It works, so its fine, just didn’t know if my site would be slower due to a repeat in code, or something.

    Also, is there any way, that I can get my Paper.li (The XinoGamez Journal) to appear only on home page and only show 4 posts above it, then in all other pages afterward to NOT show the Paper.li but to show 6 posts?

    Thanks again, my site is nearing completion. This theme is so wonderful, I had no idea it could be so editable.

    Glad it’s working. Is the code you posted above what’s actually in your index.php file? The short answer to your question is “yes” but it will take a bit more work. Late here. I’ll try to look at it tomorrow.

    Thread Starter Brian M.

    (@brimoknight)

    Haha Yes it’s whats actually in index.php. No Worries! I hear ya, late here too. Hope you get good rest! Cya!

    Thread Starter Brian M.

    (@brimoknight)

    Also, I dont mean to be pushy, but do you seriously not have a donation link? I’m almost begging. hehe I’m truly grateful and a coffee dont cost much. ^-^

    Thanks, appreciate the offer, but the time I spend on the forum is volunteer. Haven’t had a chance to look at your other question. Darn day job keeps interfering…;-)

    Thread Starter Brian M.

    (@brimoknight)

    Ahh, ok… I’ll stop pushing then…

    Oh and no worries… Life comes first. Matter of fact, I am thinking of removing it from my home page, I checked with google my load speed and other components and it seems that the embed of Paper.li might not be the best thing for my home page anyway. Slowing site down etc.

    So, forget about having only 4 posts on home page and then 6 on others and all the mumbo jumbo, if anyone ever gets to it, my updated questions is simply cleaning up the code above cause I have a feeling its doing something twice…

    That’s all for now, thanks guys! Have a great night!

    As for cleaning up your index.php, I would just copy the original file from the parent theme back over to your child theme. If you want the Paper.li ad then just add the sidebar above the pagination like you have it now.

    Thread Starter Brian M.

    (@brimoknight)

    Alrighty then, point taken… Thanks again, you have been absolutely amazing, and are a genuine and true asset to the forum/theme community!!!

    **If anyone sees this thread in the future, I have removed the paper.li widget I was referring to earlier but I have left the sidebar in place, in case I need to use it down the road!

    See ya!

    Resolved with awesomeness!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to Add Content Below My Blog Posts on Home Page?’ is closed to new replies.