Add html code before first post when using WP Page Numbers
-
Hi, I have a question
My index page shows all my post, shows 2 post per page, shows first the most recent post. I used the WP Page Numbers plug-in for pagination, and works great.
But I need to do this, before the first index page post appears in page 1 (no matter the post category) I need to add some html code before the las post, so it have to look like this:
post page 1
//some html code
post 1
post 2post page 2
//empty
post 1
post 2post page 3
//empty
post 1
post 2I′m new in WP, I have used it for 3 days (great by the way) I know that I have to add some code in the index.php between the loop of posts, I have like 15 posts but I used the function $wp_query->post_count() and it returns only 2 posts (posts per page and not the total).
So basically what i need is a function that return me the total post (no matter the category)
and having that I can add a counter and do something lige this
while…
if is_home() and if $count+1 == total
{//add html code}
show post
- The topic ‘Add html code before first post when using WP Page Numbers’ is closed to new replies.