fastk9dad (@fastk9dad)

Forum Replies Created

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

  • fastk9dad
    Participant

    @fastk9dad

    Thanks. I gave that a shot but it just put it before the pagination elements, not inside.


    fastk9dad
    Participant

    @fastk9dad

    Well I fixed the function so it works (displaying the button), but I still don’t know how to get the button into the position I want.


    fastk9dad
    Participant

    @fastk9dad

    I fixed my function above so this works now:

    function pmh_new_topic_button() {
    $forum_id=bbp_get_forum_id();
    
    	if ( is_user_logged_in() ) {
    		echo '<a href="/forums/new-topic/?ForumId='. $forum_id .'"><div class="new-topic btn">New Topic</div></a>';
    	}
    }
    
    add_action('bbp_template_before_topics_loop','pmh_new_topic_button');

    fastk9dad
    Participant

    @fastk9dad

    Hrmm, I replied last night and it looks to be gone now. Not sure if I’ve gotten moderated but I’ll put my response here again.

    Currently I’m just using this code in the content-single-topic.php template in my child theme.
    <a href="/forums/new-topic/?ForumId=<?php echo bbp_get_forum_id()?>"><div class="new-topic btn">New Topic</div></a>

    I have developed this for use in function.php to replace the above but I get a parsing error right now. It works ok if I don’t try to insert the ForumID so something is wrong with my syntax.

    function pmh_new_topic_btn() {
    	if ( is_user_logged_in() ) {
    		echo '<a href="/forums/new-topic/?ForumId=".$_GET['ForumId'].""><div class="new-topic btn">New Topic</div></a>';
    	}
    }
    add_action('bbp_template_before_topics_loop','pmh_new_topic_btn');

    Regardless of which method I use the resulting code is always placed after the bbp-pagination element and my CSS fu isn’t strong enough to have the button flow/move with the bbp-pagination-links contained within (is it even possible?).

    <div class="bbp-pagination">
    	<div class="bbp-pagination-count">
    		Viewing 3 topics - 1 through 3 (of 3 total)
    	</div>
    	<div class="bbp-pagination-links">
    	</div>
    </div>
    <a href="/forums/new-topic/?ForumId=1486">
            <div class="new-topic btn">New Topic</div>
    </a>

    fastk9dad
    Participant

    @fastk9dad

    Just following up, I have a function I can use to put the button on the page instead of changing the content-single-forum.php page in my child theme, but it still puts it outside the bbp-pagination div so I run in to the same styling issues. I’m not sure what function to use if I want to insert something into that area.


    fastk9dad
    Participant

    @fastk9dad

    Yes. I have a full child theme set up with a functions.php and modified bbpress templates as well.


    fastk9dad
    Participant

    @fastk9dad

    Update: I was able to figure out how to achieve my desired result via CSS by using this code:

    .bbppu-mark-as-read:after {
        content: '|';
        padding-left: 10px;
        padding-right: 10px;
    }

    The result:
    link separator

    In reply to: Create New Topic

    fastk9dad
    Participant

    @fastk9dad

    Thanks @robin-w! Unfortunately I couldn’t get that link to work. Oh well.

    In reply to: Create New Topic

    fastk9dad
    Participant

    @fastk9dad

    I’m trying to find where the button gets created so I can edit the link then follow the rest of this post: https://bbpress.org/forums/topic/how-to-add-new-topic-button/

    In reply to: Create New Topic

    fastk9dad
    Participant

    @fastk9dad

    I have bbp-style-pack installed and am using the button, but I don’t see any other options other than that? I’d like to also hide the form below the topics and have it on it’s separate page.

    J

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