Eric G.
Supreme Deity
In Training
Lifetime member
Lifetime Member Likes (0)
I have set up a couple of custom post types using CustomPress and am having problems with the pagination on the archive pages for those post types. Is there something I should be doing differently?
The pagination numbers show up but when I click page 2, it brings me to page 2 but still shows the latest instead of the next ones.
I have simply copied and pasted the archive template and made minor adjustments in the loop.
The normal blog archive pages work fine. It is only the custom post types.
Any help would be appreciated!
Responses (21)
DEV Diva (joined February 2012) Likes (0)
Hi Eric
Greetings from the WMPU DEV Support Team!
Thank you for your post and for being a member of our Community. Now let's tackle your problem :)
It would be good to see what adjustments you've made - if I can see the code, that would be great. It might be something small on there that need to be adjusted. Once I have the code I can check with our Developers as well and we'll get you sorted in no time.
Looking forward to your feedback.
Glad to assist!
GinaB
Lifetime Member (joined April 2011) Likes (0)
Here is the original archive code:
Lifetime Member (joined April 2011) Likes (0)
Here is the page that is not acting as it should.
Lifetime Member (joined April 2011) Likes (0)
Need anything else to help get this answered? Any help would be appreciated!
Lifetime Member (joined April 2011) Likes (0)
Ok. I have been trying a bit more to figure it out. I removed my archive page and made it so it just used the default page with no changes (1st one shown above). My normal archive pages work fine. The custom post types archive pages do not.
Would there be anything in the CustomPress settings that would need to be changed for this? Would love some help on this one.
DEV Diva (joined February 2012) Likes (0)
Hi Eric
Wow, that's a lot of code there :)
Apologies for not responding soon.
I've requested the Developer to provide feedback and suggestions on this matter. I will make sure that he respond at the earliest.
I assure you that your posts are important to us and we will try to resolve this matter for you.
Have a good day.
Gina
PS As a general rule, we request users to only paste 10 lines of code on here. Anything longer than that, we recommend they use pastebin.com and provide a link on the thread. Our bbPress Code Plugin doesn't handle much more than that very effectively.
Developer (joined January 2012) Likes (0)
Kind of guessing. There is a global wordpress variable $paged which keeps track of which page you are currently on. It's usually read from the $_POST information. I'm not familiar with the themeblvd code so I don't know how it handles pagination.
I have a suspicion the the get_template_part in the orginal but not in the modifed may be doing some counting for pagination.
You'd have to inspect the theme code to tell.
DEV Diva (joined February 2012) Likes (0)
Arnold, thank you for your assistance :)
***
Hi Eric
Please let me know how you get on with the suggestion and feedback that Arnold provided. As he mentioned, you might need to do a bit of inspection on the theme code to figure this out.
If there is anything else we can assist with, please let us know.
Have a good day!
Gina
Lifetime Member (joined April 2011) Likes (0)
@Gina,
Here is what came from the theme designer
Developer (joined January 2012) Likes (0)
If he does standard Wordpress pagination you could try echoing the global $paged variable and see if it change properly.
Put tha after your query and see what it's showing.
Lifetime Member (joined April 2011) Likes (0)
@Arnold
I assume he does not do standard Wordpress pagination.
The code for pagination is
<?php themeblvd_pagination(); ?>I did a little more searching around and found this thread.
http://themeforest.net/forums/thread/pagination-on-wordpress-static-page-set-to-front-page/28120
By the theme author! Not sure how to implement, could use help interpreting the language of it.
Developer (joined January 2012) Likes (0)
I'm familiar with that problem. For all other pages the variable name is the global $paged. If the page is the Front Page of a statis page setup for some reason it changes to $page (no d).
Is the page you're having problems with the Front page in a static setup?
If so and since he's asking those questions he probably is using standard pagination just wrapped in his own commands. The fix for the Front page problem is pretty simple.
You can try putting that at the top of your page
Lifetime Member (joined April 2011) Likes (0)
@Arnold
Thank you so much for your attention to this. I am not working with the front page on this one.
It is a CustomPress archive page. So I have the page archive-speakers.php using the plugin and I have the slug set so the custom posts show up here: http://cymhub.com/catholic-youth-ministry-speakers/
I currently have my max posts set to 15 until the problem is fixed so the pagination is not currently being used.
Developer (joined January 2012) Likes (0)
Well we need to see what's happening. As I suggested above you should echothose $paged variables to get an idea of what's happening. so far all I can do is speculate.
Lifetime Member (joined April 2011) Likes (0)
Understood.
I attempted that above, but am not sure I did so correctly. I am an absolute php newb so can you tell me where and how I post the code into what file? My archive-speakers.php is the 2nd long list of code above if you could help me figure where it should go in there.
Then what is it I should be looking for so that we can "get an idea of what is happening"
Thanks you again!
Developer (joined January 2012) Likes (0)
Tell you what. send an admin login at arnold at incsub dot com and I'll take a look direct.
Lifetime Member (joined April 2011) Likes (0)
Thanks Arnold. Got that sent off to you. Please let me know if you didn't receive it.
DEV Diva (joined February 2012) Likes (0)
@Arnold
Thank you for your support and attention to Eric's problem. Appreciated!
@Eric G.
You're in good hands now! Let me know when you get this sorted and we'll resolve the thread.
Have a good day!
Gina
Developer (joined January 2012) Likes (0)
HI Greg,
I got it working. I'm not sure what you did to get you template to display but here's how I did it.
I took you archive-speakers.php template and gave it a Template Name tag at the top.
Name doesn't matter just so long as you recognize it. Then I added the post query for the custom type "speakers"
I used a 10 for the posts per page put you could use the option above $posts_per_page if it's defined on your system. Saved the Template.
Then I made a new Page and instead of the Default template I selected your custom template. Now that it's named it will show up automatically in the list. Gave the page the title "Catholic Youth Ministry Speakers" which gives the permalinnk "catholic-youth-ministry-speakers/". Saved the blank page. Removed your old entry from the Menu and put this one in it's place. Now it works.
Lifetime Member (joined April 2011) Likes (0)
@Arnold
Absolutely the best support I have received here ever. You are awesome!
I will have to spend some time picking apart what you did as it seems like a much different approach than I am used to. I typically just check out the template hierarchy and start there instead of queries as I just have had a hard time perfecting my query magic.
Thanks so much though, a great temporary solution and your instructions on it was done will be most helpful as I train myself to do things this way.
DEV Diva (joined February 2012) Likes (0)
Hiya Greg
I'm so glad you got sorted. You were in excellent hands with Arnold. And sorry I couldn't be of more assistance.
Please don't hesitate to be in touch should you need any further assistance in the future.
Have a good day!
Gina
WordPress Questions?
We've got answers!
Find out more »