Forums

Removal of next post name. (17 posts)

  1. iselaespana
    Member
    Posted 4 months ago #

    Site in question

    My sight is set up using a category when I set it up to display all posts in one page which is the link above, in between each post appears a arrow ---> with the next post name ...

    How would I get rid of that and have the page numbered at the bottom instead?

  2. alchymyth
    The Sweeper
    Posted 4 months ago #

    in loop.php (if the child theme does not have this file, copy it from the parent theme) find (once near the top and similar near the end):

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    	<div id="nav-above" class="navigation">
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
    	</div><!-- #nav-above -->
    <?php endif; ?>

    and remove/replace (either just the bottom one or both) with something like:

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if (  $wp_query->max_num_pages > 1 ) : ?>
    				<div id="nav-below" class="navigation">
    				<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
    					<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
    					<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
    					<?php } ?>
    				</div><!-- #nav-below -->
    <?php endif; ?>

    (the code is assuming you have the plugin wp-pagenavi http://wordpress.org/extend/plugins/wp-pagenavi/ installed and activated; and please note the different css ids for the top and bottom navs. )

  3. iselaespana
    Member
    Posted 4 months ago #

    this is what i did

    It didnt change anything.

  4. iselaespana
    Member
    Posted 4 months ago #

    I would really appreciate your guidance and expertise...

    I have been having a tough time finding an answer

    FIRST...

    what I would like to accomplish is the ability to leave the grid view with only 6 posts in my (HOME PAGE)

    After the 6th post in the bottom I would like it to have pages to the previous posts in grid view.

    SECOND...

    all other pages have all posts (recipes) according to its category filed. I would like to remove the arrows and post names in between the posts and have just 6 posts on each page with numbered pages on the bottom to the previous posts.

    example

  5. alchymyth
    The Sweeper
    Posted 4 months ago #

    you don't seem to have enough posts to trigger the pagination.

    the 'number per page 'settings in the grid template is not applied because of your edits to the template which was designed to be a page template.
    if you use that as the general template, you need to make sure to merge the parameters into the existing query_string. http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note

    adapted loop-grid code: http://pastebin.com/t1U1dkUv
    (untested)

    what is your setting in dashboard - settings - reading - Blog pages show at most [] posts?
    make sure that setting is 6.

    the 'post names with arrows' in the category archive seem to be coming from some 'next_post_link()' code possibly copied from loop-single.php - remove that.

    also check that the 'wp_pagenavi()' adaptation is entered into the loop for the category archive - loop.php ?

  6. iselaespana
    Member
    Posted 3 months ago #

    Thanks so much for your help!! I got the pagination working in my home page finally... one question... its above my grid post thumbnails could it be moved below?

    My settings in dashboard are set to 6

    the post names with arrows I was not able to get rid of. I tried getting rid of the next post link () but in my loop_single.php but it didn't do anything:

    <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>

    * you also said : also check that the 'wp_pagenavi()' adaptation is entered into the loop for the category archive - loop.php ?

    I looked in loop.php and it is there.. am I suppose to change it in category.php or archive.php?

  7. alchymyth
    The Sweeper
    Posted 3 months ago #

    the position of the numbered pagination links seems to be caused by some float issue;

    try and add this to line 102 of http://pastebin.com/t1U1dkUv :

    <div style="clear:both; float:none;"></div>

    as for the category archive problem, please paste the full code of category.php and loop.php (or whatever template gets called in category.php) into two pastebin.com and post the links to these here.

  8. iselaespana
    Member
    Posted 3 months ago #

    The loop.php

    The category.php

    Is there a way to add a little margin to the bottom of the pagination? I tried adding a style to the div of margin-bottom: 10px; but had no luck.

    Thanks for taking so much time to help me out! I sincerely appreciate it!!

  9. alchymyth
    The Sweeper
    Posted 3 months ago #

    for the category archives,

    remove lines 17-20 and lines 57-60 in http://pastebin.com/3khh3qPz

    in place of lines 57-60 add:

    <?php if (  $wp_query->max_num_pages > 1 ) : ?>
                                    <div id="nav-below" class="navigation">
                                    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
                                            <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
                                            <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
                                            <?php } ?>
                                    </div><!-- #nav-below -->
    <?php endif; ?>

    the category.php should then look like this:

    http://pastebin.com/hGSv5U6h

    for the pagination numbers, try to add something like this to the end of style.css of the child theme:

    .wp-pagenavi { padding-bottom:30px; }
    or
    #nav-below { padding-bottom:30px; }

  10. iselaespana
    Member
    Posted 3 months ago #

    Thanks!!! Doing as you stated got everything to work.

    There is only one thing that seems like is still not working properly. The pagination for my pages that show all posts still have the pagination in between each post.

  11. iselaespana
    Member
    Posted 3 months ago #

    could it be from my home.php file?

  12. alchymyth
    The Sweeper
    Posted 3 months ago #

    home.php is innocnet.

    I actually fuzzed the category.php code and put the 'pagination' into the wrong space ;-)

    this is revised code:

    http://pastebin.com/qmRfskCE

  13. iselaespana
    Member
    Posted 3 months ago #

    Thank You so much!!! It's perfect!!

    Your time, patience and kindness is so much appreciated!!

  14. alchymyth
    The Sweeper
    Posted 3 months ago #

    you are welcome - glad i could help to get your nice recipe site working ;-)

  15. iselaespana
    Member
    Posted 3 months ago #

    Dear Alchymyth,

    another little cliche seemed to pop up when I added another post.

    The pagination in the bottom got distorted. I tried to fix it with css. I have not been able to. Any thoughts??

    Isela

  16. alchymyth
    The Sweeper
    Posted 3 months ago #

    to change that, try to add this to the end of style.css of the child theme:

    .navigation { clear: both; }

    and optionally:

    .wp-pagenavi {
    	clear: both; text-align:center; padding-top:3px;
    }
  17. iselaespana
    Member
    Posted 3 months ago #

    Thanks so much... I love it. :)

Reply

You must log in to post.

About this Topic