Skip to:
Content
Pages
Categories
Search
Top
Bottom

single.php has wrong function and format to show next and/or previous post link.

  • Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    I posted to http://trac.buddypress.org/ticket/2982

    /bp-themes/bp-default/single.php has a wrong function and format to show the next and/or previous post link.

    [ Original ]
    <div class=”alignleft”><?php next_posts_link( __( ‘? Previous Entries’, ‘buddypress’ ) ) ?></div>
    <div class=”alignright”><?php previous_posts_link( __( ‘Next Entries ?’, ‘buddypress’ ) ) ?></div>

    Should be

    [ Changed to ]

    <div class=”alignleft”><?php next_post_link(‘%link’, __( ‘? Previous Entries’, ‘buddypress’ ) ) ?></div>
    <div class=”alignright”><?php previous_post_link(‘%link’, __( ‘Next Entries ?’, ‘buddypress’ ) ) ?></div>

    However, this still will collapse the format of page, thus I recommend:

    [ Changed to ]

    <table>
    <tr><td class=”alignleft”>
    <?php previous_post_link(‘%link’, ‘?¬†%title’) ?>
    </td><td class=”alignright”>
    <?php next_post_link(‘%link’, ‘%title¬†?’) ?>
    </td></tr>
    </table>

    Note that %title can be changed to the default of “__( ‘? Previous Entries’, ‘buddypress’ )” and “__( ‘Next Entries ?’, ‘buddypress’ )”

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    A table construct is not an appropriate structure – this is not tabulated data if anything it’s a list and a ul would be the structure best suited.

    Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    Thanks for you comment,@hnla

    Yes, I have tried a various ways, and have found that <div> and <ul> collapse the layout of post.
    Try and you will see what I mean.

    Anyway, the point is that single.php uses a wrong function.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    If elements cause an issue then that needs to be addressed and is a presentational matter, Semantics is a different subject and dictates that the correct elements are chosen to describe the data, regardless of presentation which comes later.

    A ul won’t collapse the layout, however if you floated the li elements then you would need to ensure that you had used an appropriate method of ‘containing floats’ e.g ‘overflow:hidden;’

    Avatar of leonzinger
    leonzinger
    Member

    @leonzinger

    Just add the class clearfix in item-options (the div that wraps these previous and next links)

    and be sure you have the appropriate CSS for that class

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.