Community Forums › Forums › Archived Forums › General Discussion › archive page pagination
- This topic has 10 replies, 3 voices, and was last updated 11 years, 1 month ago by sundance.
-
AuthorPosts
-
March 9, 2013 at 9:44 pm #25252sundanceParticipant
HI I created a custom archive page for category , I'm trying to add pagination at the end , I saw many topics but still can't figure it out
http://www.mepanorama.com/%D8%A7%D9%84%D8%A3%D8%B1%D8%B4%D9%8A%D9%81/
any help would be great, this is what I have
<?php
/**
* Template Name: Archives
*/remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'custom_archives' );function custom_archives() { ?>
<h3 >
<?php _e('آخر الاخبار', 'genesis'); ?>
</h3>
<div class="widget-wrap">
<?php
$catquery = new WP_Query( 'cat=&posts_per_page=35' );
while($catquery->have_posts()) : $catquery->the_post();
?>
<ul>
<li><a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_time(); ?>
-
<?php the_title(); ?>
</a>
</ul>
<?php endwhile; ?>
</div>
<?php}
genesis();
March 10, 2013 at 1:12 am #25270Brad DaltonParticipantYou might find this interesting http://www.briangardner.com/custom-archives-page/
It should be displayed if you have the settings configured correctly at Genesis > Theme Settings > Content Archives
March 10, 2013 at 8:44 am #25306sundanceParticipantThanks for the reply
I used the exact same code , but still no pagination ..
any thoughts ?
March 10, 2013 at 9:53 pm #25417Brad DaltonParticipantNo sorry. You could add previous and next post tags but thats probably not what you want.
Try the wordpress.stackexchange.com
March 10, 2013 at 10:00 pm #25418sundanceParticipantNo worry , Actually Next previous is good enough , but how to do it ?
March 11, 2013 at 10:14 pm #25578Bill MurrayMember@sundance - Is the code you posted your exact template? If so, it doesn't look like you have a category specified in your WP query. Perhaps that's the source of your trouble 🙂
You also might benefit from having a look at the Template Hierarchy article in the WP codex.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
March 11, 2013 at 10:29 pm #25583sundanceParticipantwell , I just tried to specify category now , but same thing.
I did not specify category because I want latest post from all categories.
the exact code now - after I followed the tutorial you mentioned earlier - is like this
<?php
/**
* Template Name: Archives
*/remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'custom_archives' );
function custom_archives() { ?><h1 class="entry-title"><?php _e('آخر الاخبار', 'genesis'); ?></h1>
<div class="widget-wrap"><h4><?php _e(' ', 'genesis'); ?></h4>
<ul>
<?php $recent = new WP_Query("cat=&showposts=30"); while($recent->have_posts()) : $recent->the_post();?>
<li><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"> <?php the_time(); ?> - <?php the_title(); ?></a> </li>
<?php endwhile;?>
</ul>
</div><?php
}
genesis();
March 11, 2013 at 10:44 pm #25586Bill MurrayMember1) I've never seen where one could use a blank category as you posted it to retrieve all posts.
2) I didn't give you a link to a tutorial.
3) If you want all categories, you might benefit from reading Bill Erickson's article on customizing WP Query.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
March 11, 2013 at 10:49 pm #25591sundanceParticipant1- blank category to show all posts from all categories.
2- I means this http://www.briangardner.com/custom-archives-page/ you posted earlier.
3- this seems interesting , thanks.
March 11, 2013 at 10:55 pm #25593Bill MurrayMember1) You can't use a blank category the way you're using it. If you think you can, show me the source. You have to use something like cat=2. See the codex page I linked to.
2) I didn't post that. Take a look at the names on each post. Brad Dalton posted that link, not me.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
March 11, 2013 at 11:02 pm #25594sundanceParticipant1- yes I'm looking at it , it explains a lot.
2- sorry my mistake.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.