kodacollider (@kodacollider)

Forum Replies Created

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

  • kodacollider
    Participant

    @kodacollider

    I got the pagination for topics and for replies above/below each respective loop working, but I can’t seem to find out how to hook into this one to apply the same effect:

    That’s the pagination for topic replies listed right beneath the topic’s title when viewing a single forum.

    Any ideas?


    kodacollider
    Participant

    @kodacollider

    I’m not, I am using a child theme of Twenty Twelve that I’ve been creating.

    I actually got this figured out, on a whim I decided to try your $args[‘type’] = ‘list’; again and for whatever reason this time it worked. I don’t know if I may have just overlooked it the first time, or what.

    My function:

    function bbp_custom_pagination_links( $args ) {
        $args['type'] = 'list';
        return $args;
    }
    add_filter ('bbp_topic_pagination','bbp_custom_pagination_links');

    I will still have to go through and do the same thing for other instances of pagination within bbPress, but that has worked for the topic list. It’s just a matter of styling the list elements with CSS at that point to get them aligned horizontally.

    Thanks for all of your help, I really do appreciate it.


    kodacollider
    Participant

    @kodacollider

    Any other ideas, by chance?


    kodacollider
    Participant

    @kodacollider

    This is not from the search, though I wouldn’t be surprised if it does the same thing there as well. It does it for the pagination for a list of topics, yes, but also for the list of replies when viewing a topic (and when listing pages of a topic beneath the topic title when viewing a forum).

    I am using child theme files. However, I see the pagination functions defined in:

    /wp-content/plugins/bbpress/includes/topics/template.php
    /wp-content/plugins/bbpress/includes/replies/template.php

    etc… and those files, of course, are not among my child theme files.

    I tried your function, and it did add a space after each page number (though inside the anchor tag, not after it). It didn’t, however, removed the <br> tags. I tried plain as well as list, as commented.

    Thanks for your help so far.


    kodacollider
    Participant

    @kodacollider

    I’m not able to link to the site directly right now, unfortunately, but this is what the source looks like for the pagination area:

    <div class="bbp-pagination-links">
    <p>	<span class="page-numbers current">1</span><br>
    <a class="page-numbers" href="https://www.com/topic/test-1/page/2/">2</a><br>
    <a class="next page-numbers" href="https://www.com/topic/test-1/page/2/">→</a>
    </p></div>

    kodacollider
    Participant

    @kodacollider

    Thank you. I’m having a little bit of trouble.

    I found the original function I need to edit in bbpress/includes/topics/template.php:

    function bbp_get_topic_reply_link( $args = array() ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'reply_text'   => esc_html__( 'Reply', 'bbpress' ),
    		), 'get_topic_reply_link' );
    
    		// Get the reply to use it's ID and post_parent
    		$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
    
    		// Bail if no reply or user cannot reply
    		if ( empty( $topic ) || ! bbp_current_user_can_access_create_reply_form() )
    			return;
    
    		$uri = '#new-post';
    
    		// Add $uri to the array, to be passed through the filter
    		$r['uri'] = $uri;
    		$retval   = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after'];
    
    		return apply_filters( 'bbp_get_topic_reply_link', $retval, $r, $args );
    	}

    The only line I need to modify is:

    $retval = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after'];

    Is there an easier way to phrase my new function to modify just this variable?

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