Archived

This topic is now archived and is closed to further replies.

  • 0

How to include sticky posts within the 'Blog pages show at most' WP setting


Question

Posted · Report post

I'd like to make blog pages be a set number of posts per page including sticky posts.

 

It looks like the way WP works is to add on all the sticky posts to the 'Blog pages show at most' WP setting - so if you have 2 sticky posts and have set the 'Blog pages show at most' setting to 10 the first blog page will show 12 post.

 

I'd prefer that every page only shows 10 posts - so the first blog page would show 2 sticky posts + 8 'normal' posts = 10 posts on the page.

 

I'm guessing this would mean using a base child theme and altering 'the loop' somehow?

 

Any help much appreciated.

Share this post


Link to post
Share on other sites

31 answers to this question

Posted · Report post

OK, I have just enable Twenty Twelve and the issues persists, therefore you will need to contact Wordpress support. There is something wrong with your Wordpress installation from the looks of it, as this is not normal behaviour.

Share this post


Link to post
Share on other sites

Posted · Report post

Simon,

 

Simon (ours) will be back in tomorrow morning, GMT.  I'll leave him a note.

Share this post


Link to post
Share on other sites

Posted · Report post

I've deactived all plugins but still 12 posts showing on the blog page - 2 sticky + 10 normal posts.

 

When I change the WP setting from 10 to 8 I then get 2 sticky + 8 normal posts.

 

I've swapped themes and the same thing happens.

 

All the support posts I ready on the subject seemed to indicated this was how it was designed to work.

Share this post


Link to post
Share on other sites

Posted · Report post

I get the same result as our developer Simon, I cant recreate your issue.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Danny - will do.

Share this post


Link to post
Share on other sites

Posted · Report post

Can you please try the default wordpress theme and see if you still get the problem.

Share this post


Link to post
Share on other sites

Posted · Report post

Could it be something with my installation - ie server settings and not WP or Pagelines?

Share this post


Link to post
Share on other sites

Posted · Report post

Can you provide your PHPinfo and enable PageLines debug mode please, then we can if this is the case.

 

PHPinfo - http://codex.wordpress.org/Finding_Server_Info

PageLines debug - PageLines > Site Options > Advanced

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks, yes I've done that - I don't want to disclose the web address though - can I send this to you via email?

Share this post


Link to post
Share on other sites

Posted · Report post

Send it via the URL so I can check the debug and also link me to the phpinfo please.

Share this post


Link to post
Share on other sites

Posted · Report post

The site is in development in a subdirectory i.e. WP is not installed in the root directory - could it be something to do with that?

Share this post


Link to post
Share on other sites

Posted · Report post

I have just installed Wordpress into a sub directory and have no issue, the sticky posts are working as intended. You mention in a earlier post, you switched theme and had the same outcome. Therefore, this is most likely an issue with either your Wordpress installation or your server.


I recommend you ask this question on the Wordpress support forums as their team will be best suited to resolve your issue, due to it most likely being Wordpress related.

Share this post


Link to post
Share on other sites

Posted · Report post

After viewing your debug information, I noticed that you have a plugin installed called Sticky Posts, why are you using this plugin ?

 

When testing, I never used any plugin, so this may be the cause of your issue.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks, it would be good to know whats going on! :)

Share this post


Link to post
Share on other sites

Posted · Report post

I deactivated it and all plugins and the issue was still there - I can deactivate everything again if you like?

 

The plugin dsiaplays the 2 most recent sticky posts on the homepage.

Share this post


Link to post
Share on other sites

Posted · Report post

I have no way to reproduce this, I have tried it with total posts set to 5 with 1 and 2 stickies and every time i get 5 posts on the blog page, tried with the framework, 2010, 2011 and 2012 themes all the same result.

You can see here http://pross.org.uk/ top post is a sticky and only 5 results.

 

Maybe there is a plugin you are using interfering with the loop?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

If a third party plugin is causing you to see two extra posts and you don't want them, the solution would be to deactivate the plugin.  Neither WordPress nor PageLines do 'sticky posts' on their own.  I think my colleagues were confused between full-width posts and sticky posts.  That can be established via settings.

 

There are many options for sticky-post placement, from addition of PHP code to shortcode options on the blog page. However, you may not add any content to the editing field.

 

What you can do is activate a sidebar (full width, universal or content box) via Drag & Drop in the Blog template at Dashboard > PageLines > Drag & Drop > Content Area making sure that the sidebar is placed above the top of PostLoop.

 

Then, you'd go to Dashboard > Appearance > Widgets.  Add a text widget to the sidebar and in the text widget, add any code you were expecting to use on the blog page.  If you're using Content Box, you'd do it via Dashboard > PageLines > Page Options > Blog > Content Box, adding the code needed, right there.

Share this post


Link to post
Share on other sites

Posted · Report post

hey did anyone figure this out. im having the exact same problem

Share this post


Link to post
Share on other sites

Posted · Report post

I had tried this before and had the same problem - tried it again anyway - all plugins deactivated, tried all 3 WP default themes - Twenty 10, 11 and 12.

 

3 sticky posts, 'Blog pages show at most' = 5

 

Posts appearing on blog page = 8 for all themes (3 sticky + 5 normal)

Share this post


Link to post
Share on other sites

Posted · Report post

Can you provide a link to the site in question please (I apologise if you have previously linked, I was unable to see) and in the custom CSS for that site, can you add the following CSS.

 

So we can clearly see the sticky posts.

 

 

.sticky { background: red; }

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Danny,

I've just emailed you the URL and I've added the CSS as requested (all plugins are off including pagelines customization plugin)

Many thanks in advance.

Share this post


Link to post
Share on other sites

Posted · Report post

I have just sent you a reply, can you reply to my PM and send me admin access to the site please.

Share this post


Link to post
Share on other sites

Posted · Report post

Just done that Danny.

Share this post


Link to post
Share on other sites

Posted · Report post

@gayatriom Since this issue is WordPress issue (as pointed out in Danny's post above) and we cannot provide WP support, you will need to post an inquiry on the WP tech forum: http://wordpress.org/support

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks but as I've mentioned a couple of times I've disabled all plugins and its still happening so it's not looking like it could be a plugin.

 

I'm already using a content box elsewhere on the site so if needed I'll look at that but at the moment it doesn't look like it is the sticky post plugin as the problem is still happening with all plugins disabled.

Share this post


Link to post
Share on other sites