Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Design of Pagination

  • @joshposh

    Member

    [Sorry if this is the wrong place to ask, I couldn’t find a better one]

    I know it a lot to ask but could someone help me with a short piece of code please? I never worked with PHP and would like to insert a bit of HTML into a piece pf PHP. I would really appreciate any help.

    The Problem:

    I have some not so web savvy users at my board and I’d like to make the pagination of threads better to see for them.

    At the moment it’s kinda tiny and has no spaces between the page numbers for some strange reason.

    (Screenshot of how it looks at my board: http://f.imagehost.org/0070/toosmall.png)

    I guess I found the place to change it in the post-template.php

    $output = '';
    if ( $multipage ) {
    if ( 'number' == $next_or_number ) {
    $output .= $before;
    for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {
    $j = str_replace('%',"$i",$pagelink);
    $output .= ' ';
    if ( ($i != $page) || ((!$more) && ($page==1)) ) {
    if ( 1 == $i ) {
    $output .= '<a href="' . get_permalink() . '">';
    } else {
    if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
    $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
    else
    $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
    }

    }
    $output .= $link_before;
    $output .= $j;
    $output .= $link_after;
    if ( ($i != $page) || ((!$more) && ($page==1)) )
    $output .= '</a>';
    }
    $output .= $after;
    } else {
    if ( $more ) {
    $output .= $before;
    $i = $page - 1;
    if ( $i && $more ) {
    if ( 1 == $i ) {
    $output .= '<a href="' . get_permalink() . '">' . $link_before. $previouspagelink . $link_after . '</a>';
    } else {
    if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
    $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $link_before. $previouspagelink . $link_after . '</a>';
    else
    $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $previouspagelink . $link_after . '</a>';
    }
    }
    $i = $page + 1;
    if ( $i <= $numpages && $more ) {
    if ( 1 == $i ) {
    $output .= '<a href="' . get_permalink() . '">' . $link_before. $nextpagelink . $link_after . '</a>';
    } else {
    if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
    $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $link_before. $nextpagelink . $link_after . '</a>';
    else
    $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $nextpagelink . $link_after . '</a>';
    }
    }
    $output .= $after;
    }
    }
    }

    if ( $echo )
    echo $output;

    return $output;
    }

    And I would like to change the visual output to this

    <p><strong>  Next Page ></strong></p>

    for “Next”

    and

    <p><strong><  Previous Page  </strong></p>

    for “Previous”

    Thanks for your time :)

    [and please excuse my poor English xD]

Viewing 5 replies - 1 through 5 (of 5 total)
  • @chrishajer

    Participant

    Please don’t modify any core files. What you are asking can be done in your template files. What template are you using? Please post a link to your forum so we can show you the proper place to modify this. If you look at other bbPress sites, the pagination does not look like yours. The way that looks is a theme function, not a core function.

    @joshposh

    Member

    Oh, OK.

    I’m using the Structure theme but I just realized (by seeing it in it’s native state at http://bbshowcase.org/forums/?bbtheme=bbpress-structure) that the problem with missing spaces between the numbers seems to be something I screwed since it works in the original.

    @_ck_

    Participant

    They completely broke the pagination formatting in 1.0 in all themes. It was reckless.

    @joshposh

    Member

    I found out that the CSS class for the definition of the pagination was missing in the CSS file of the theme. I’ve added it but can’t figure out how to change the space between the page numbers. I tried padding, margin and letter-spacing and they all worked for the text (“next” & “previous”) but not for the page numbers :/

    EDIT: OK, works now but looks still stupid *sigh*

    http://f.imagehost.org/0960/p1.png

    @chrishajer

    Participant

    Can you post a link to your forum please? I’m sure someone can come up with a solution for you if they can see the markup and the CSS.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar