The common widget in blog is placed at sidebar besides the main content. We are eventually see the blog place its sidebar on the left or right alignment of the main content. And more blog add the sidebar below the main content. When we have it on our own we may bored because there a lot of another blog done the same design with what we’ve done.
The solution is come to homepage of blog list post. In this page, we can do some improvement placing ads, widget and more additional content . The trick is just about iterate variable. We just need to giving the Integer data type variable and define it as 1 in beginning. Then we need adding some division to end section of post list. Within this division you have to do some exclusion with if else bracket. Filter the exclusion based on iteration(e.g. iteration equal to 3). And in the end of exclusion add the iteration action for iteration variable.
/*The container of main content */
...
int i = 1;
/* The post list divission here*/
if(i=3){
// do your widget here
}
/*End of post list divission*/
This trick does work in tutopod to add the popular post, as you can see i place them on 3rd iteration. The way of doing it manually (without plugins) in wordpress, joomla and drupal will coming next.
"
No comments:
Post a Comment