Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,376 through 1,400 (of 32,467 total)
  • Author
    Search Results
  • gerryj
    Participant

    Hello,

    I am currently customizing my topic pages and noticed that in the bbp-header as well as the bbp-footer the two elements bbp-reply-author and bbp-reply-content exist.
    I can’t seem to figure out what these elements do there?
    Every reply has these two elements, but there they make sense because within these elements the different sections of the replies are located.
    Can you tell me if they actually do something in the bbp-header ad bbp-footer, if they don’t do anything I’m just gonna delete via my child theme to get rid of the unnecessary code

    #225372
    dusemedia
    Participant

    According to the documentation, the code below enables paste as plain text in the visual editor:

    function bbp_tinymce_paste_plain_text( $plugins = array() ) {
        $plugins[] = 'paste';
        return $plugins;
    }
    add_filter( 'bbp_get_tiny_mce_plugins', 'bbp_tinymce_paste_plain_text' );

    It works fine when using the full visual editor, enabled by this code:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        $args['teeny'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    But paste as plain texts does not work when using the Teeny editor, enabled with this code:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    Does anyone have a snippet to enable paste as plain text when using the Teeny editor?

    #225355
    conniefournier
    Participant

    I did refer to them and they said that I should find out what metadata was needed by BBPress, and make sure that was added when the form was submitted.

    I researched the docs here and found that I needed to include _bbp_forum_id and _bbp_topic_id. So, the replies were being posted to the correct forum and topic, but they weren’t showing up on the front end of the forum. I read elsewhere in this forum that the post_parent had to be updated, so I did that using a code snippet.

    But, the problem is that I am missing something for BBPress. Gravity Forms and the extension are working properly, but something is missing in BBPress until I update the topic from the back end.

    conniefournier
    Participant

    I am using Gravity Forms and their Advanced Post Creation Add-On to submit replies to topics in my forum.

    I added a code snippet to add the post_parent to the reply using the gform after submission hook.

    I checked in the database, and that is working properly.

    The only problem is that the reply does not show up on the front end…until I update it, then it works properly.

    Is there something I am missing in this process?

    #224433
    Robin W
    Moderator

    untested but

    
    bbp_get_topic_subscription_link (array( 'object_id'  => $topic_id) ))
    #224432
    thesupplyroom
    Participant

    Hello,

    Is there a way I can edit the forums pages to include a banner BEFORE the topic? so for example, on my “latest topics” page I have an image before using shortcode [bbp-topic-index].

    So I would like that same image to carry through at the top of my forum topics on:

    http://www.mywebsite/forums/topic/topic-title

    I understand I can achieve this by changing the topic category description to the banner and then using the BBP Style Pack plugin to set “show description” but this isnt an ideal solution as it only shows on the forum category list not on the actual posts…

    Any ideas?

    #224394
    kbtwen
    Participant

    Hi,
    I want to search forum (topics and replies) by user name.

    I add input with name “bbp_search_by_user”

    <input type="text" name="bbp_search_by_user" id="bbp_search_by_user" value="" />

    in form-search.php

    but how can I get value of “bbp_search_by_user” in my custom function file since $_GET[‘bbp_search_by_user’] doesn’t show anything?

    Thanks

    #224391
    pluckvermont
    Participant

    So our site typically has minimal users, myself and a few admins. We login properly and make the edits to the site.

    We have a forum set-up coming online. Our registrants to the forum will get an email when they register. They’ll register from the bbpress shortcode I included on a page.

    Instead of saying “Welcome the forum”, the email they receive says New User Registration.
    The URL it provides is the /wp-login, not the page with the bbpress login shortcode. It’s a default WP registration and login.

    I’d liked to customize emails going to forum registrants that are specific to the forum.

    Does that make sense?

    Thx–

    #224390
    dalton125
    Participant

    I think this post belongs in the “Development” forum, but that forum has a message saying that it’s closed to new posts. Let me know if there’s a better place for my question.

    I’m trying to create a navigation sidebar for users to navigate my bbPress forum. I’ve seen WordPress themes with a navigation sidebar for blog posts which has a list of months and years, as in:

    August 2021
    September 2021
    October 2021

    And clicking any of those list items will show the user any blog posts created in the given month. This is what I’d like to emulate with bbPress — a sidebar with links to different months, and clicking the link will show the user all forum topics created in that month.

    Does anyone have advice on how to do this? I’ve looked through the bbPress settings and even installed the bbp style pack plugin, but I can’t find a setting that will do what I’m trying to do. Is there a plugin or setting that I’ve missed? I don’t mind writing code to solve this problem, but I’m a PHP beginner so I’m not sure where to begin.

    I’m using WordPress 5.7.2 and bbPress 2.6.6. I don’t have a live version of my site to show.

    #224366
    maksanse
    Participant

    Thank you Robin for this so quick answer 🙏

    I already use your awesome plugin + additional shortcodes (thanks a lot).
    But it doesn’t allow me to get (and use) the information “Is there any topic to read for this user ?” so that I use it in my menu…

    By reading this post : https://bbpress.org/forums/topic/get-topics-of-subscribed-to-forums/
    I ask myself if there is a way to make a function that :

    1) get the subscribed forums html
    2) check if there is the “unread” tag in this html
    3) return YES or NO (or best : the number of “unread” occurences)

    Do you think this is feasible ?

    maksanse
    Participant

    Hello there,

    I look for a shortcode that would allow me to display to the user the number of unread topic in his subscription (or at least, if there is any unread topic there).

    I have looked for it for a long time and couldn’t find anything suiting my needs or functional.

    Does anymone have an idea or solution to this need ?

    (My aim : without using buddypress, display a “user notification bell” on my menu with an indication to the user when unread topics are available… Pretty classic use case, but not so easy to find 😅 )

    Thank you for your help or clues 🙏

    #224361
    mbfit
    Participant

    I thought that I got it here, on a page that had various code to add to your WP site. If I could find it again I’d likely be able to resolve it…

    Robin W
    Moderator
    .bbp-topics ul.sticky,
    .bbp-forum-content ul.sticky
    {
    background-color: blue !important;
    }
    #224320
    mbfit
    Participant

    Can’t remember where I found this code, tried a search, but it use to show 4 topics underneath the Forum headers but no longer shows anymore. Was this affected on an update or perhaps if someone can direct me to the page that had these codes? Thanks.

    /*
    * Show 4 topics for Forum Groups
    */
    ul.bbp-forums-list li:nth-child(n+5) {
    display: none !important;
    }

    #224268
    Ludovic S. Clain
    Participant

    Hi Robin,
    thank you for your reply.

    For your reference, wp-cli commands often (if not all) have default outputs and they do not need to be explicitly declared unless particular outputs are expected.

    Here is a list of all post types available on my WordPress installation:

    https://markuphero.com/share/5dn5FOkMzGNpG9R6Unbx

    As you can see, I have a custom post type named ‘sfwd-lessons’ so if I run the command wp post list --post_type=sfwd-lessons I have all these custom posts which are listed with the default outputs:

    https://markuphero.com/share/8Mbqbgujeaou2QH60l1k

    But when i’m trying wp post list --post_type=topic the output is empty:

    https://markuphero.com/share/3APucSjLM0IHRgLHIuVb

    https://markuphero.com/share/V3pihOOXPNQWUx3Knzqd

    Have you really tried it on your end?

    Warm regards,
    Ludovic

    #224254
    Ludovic S. Clain
    Participant

    Hi there,
    if I run a command like wp post-type list I have ‘forum’, ‘topic’ and ‘reply’ which are listed but when I run wp post list --post_type=topic the table remains empty , is this normal?
    Thanks for your help!
    Ludovic

    #224159
    Robin W
    Moderator

    spectators should not be able to create topics.
    Participants by default can.

    you will either need to

    change participant permissions -see this

    Custom Capabilities

    or add

    Private groups

    and set up topic permissions which will then let you set up a group with permission to reply only

    #224148
    Robin W
    Moderator

    you can make a topic ‘super sticky’ which will make it appear at the top of all forums.

    I know of nothing that will do a couple of forums, and indeed the code to do so would need to catch lots of areas, such as subscriptions, freshness etc. which at the moment rely on the ‘post parent’ table element of WordPress, so lots of code might be needed to get it to work.

    #224126
    Robin W
    Moderator
    add_filter( 'bbp_get_forum_freshness_link', 'rew_show_forum_freshness' , 10 , 6) ;
    
    function rew_show_forum_freshness ($anchor, $forum_id, $time_since, $link_url, $title, $active_id ){
    	return $time_since ;
    }
    
    add_filter( 'bbp_get_topic_freshness_link', 'rew_show_topic_freshness' , 10 , 6) ;
    
    function rew_show_topic_freshness ($anchor, $topic_id, $time_since, $link_url, $title){
    	return $time_since ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    gerryj
    Participant

    Hello bbpress Support

    I have two separate problems but for convenience sake, I’ll just open one topic.
    I am currently in the process of building a Forum for an already existing website.
    The Owner of this website wants threaded replies to be active for this forum so that users can reply to comments more directly. The problem is that as soon as the threaded replies are active the Page pagination just disappears and everything is displayed on one page. I’ve read online that those two features don’t work together on purpose, but why would that be? Nothing in the plugin mentions or even hints to it that these two features wouldn’t work together. Is there any kind of workaround for this or a custom script maybe? I have knowledge of PHP and JS so any kind of help would be appreciated.

    The Next issue is that there seems to be no way to collapse/expand threaded replies. Since the pagination didn’t seem to work I thought collapsing threaded replies would help or else the topic pages would just get crazy long. Is there any code out there that would help me achieve this?

    Any kind of help on even one of these issues would be appreciated.
    I Would like to avoid working in the plugin itself if possible for obvious reasons.

    Thanks in advance
    Gerry Zeller

    #224117

    In reply to: Shortcodes in Sidebar

    aaronmckeon
    Participant

    I’m using WP Astra as my theme and the plugin Sidebar Manager (also from Brainstorm Force), which just replaces the theme’s main sidebar with a different one based on the post type being displayed. Inside of the sidebar is a widget and inside of the widget, there are the shortcodes that aren’t being rendered. Let me know what other specific details I might be able to offer that would help. Thanks.

    #224114
    Joel mohanraj
    Participant

    Hi,

    Thank you for your reply. I have done first 2 steps. For the third step, you mentioned about this code

    ` return apply_filters( ‘bbp_get_forum_freshness_link’, $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
    }

    Please let me know how to change this.

    Thank you,
    Joel.

    #224107
    Robin W
    Moderator

    untested, but this should take out newlines and change the excerpt length to 150 – just change the 150 in the code to whatever length you want.

    so firstly you need to alter the default in wordpress which is 55 so

    add_filter( 'excerpt_length', 'rew_change_default_length' ) ;
    
    function rew_change_default_length () {
        return 150;
    }

    then alter it in the bbpress function, and change to take out line breaks

    add_filter ('bbp_get_topic_excerpt' , 'rew_remove_line_breaks', 10 , 3) ;
    
    function rew_remove_line_breaks ($excerpt, $topic_id, $length){
    		$topic_id = bbp_get_topic_id( $topic_id );
    		//change length here
    		$length   = 150 ;
    		$excerpt  = get_post_field( 'post_excerpt', $topic_id );
    
    		if ( empty( $excerpt ) ) {
    			$excerpt = bbp_get_topic_content( $topic_id );
    		}
    
    		$excerpt = trim( strip_tags( $excerpt ) );
    		
    		//take out line breaks
    		$excerpt = preg_replace("/\r|\n/", "", $excerpt);
    
    		// Multibyte support
    		if ( function_exists( 'mb_strlen' ) ) {
    			$excerpt_length = mb_strlen( $excerpt );
    		} else {
    			$excerpt_length = strlen( $excerpt );
    		}
    
    		if ( ! empty( $length ) && ( $excerpt_length > $length ) ) {
    			$excerpt  = mb_substr( $excerpt, 0, $length - 1 );
    			$excerpt .= '&hellip;';
    		}
    		
    		
    		// Filter & return
    		return apply_filters( 'rew_get_topic_excerpt', $excerpt, $topic_id, $length );
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #224097
    aaronmckeon
    Participant

    I’ve noticed that any shortcodes in my sidebar are not rendering on bbPress pages. Is there a way to make it so shortcodes are rendering properly? I’ve been searching the forums and can’t seem to find an answer to this. Thanks for any help.

    – Aaron

    #224096
    elliesatt
    Participant

    Ah OK – I’ve just found out that RankMath simply extracts the bbpress topic excerpt and uses that for the meta description, i.e. bbp_topic_excerpt()

    Is there a way to make bbp_topic_excerpt() ignore line breaks and increase character limit?

Viewing 25 results - 1,376 through 1,400 (of 32,467 total)
Skip to toolbar