Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,501 through 8,525 (of 32,508 total)
  • Author
    Search Results
  • #163368

    In reply to: Something Wrong

    Robkk
    Moderator

    That guide was for earlier version of bbPress ,it might be archived later for a new guide to take its place.

    The following is written for version 2.2 of the bbPress WordPress plugin. Information in this tutorial may not be applicable to earlier or subsequent versions of the plugin.

    See if the creating a theme section would help you.

    Right now there is really just some placeholder links and text that I just wrote up real quick , so this guide might be improved in some later days.

    It should help you create a child theme, understand what is usually in a theme. and how to customize it to your needs.

    Customizing

    #163360
    Robkk
    Moderator

    It should do this by default , if you haven’t already try these troubleshooting steps especially the plugin issue steps.

    Troubleshooting

    If nothing works contact your theme author

    #163353
    BBIndikator
    Participant

    It’s really strange. After the post is submitted (and as long as status is pending), the topic is included in the users subscriptions: (var_dump on wp_footer)

    bbp_get_user_subscribed_topic_ids( $reply_author_id );

    bbPress Moderation uses the hook “pending_to_publish” to send an Info to all subscribed users that this new reply is published:

    function pending_to_publish( $post )
    {
       ...
       bbp_notify_topic_subscribers( $reply_id, $topic_id, $forum_id );
    }

    If I add this:

    bbp_get_user_subscribed_topic_ids( $reply_author_id );

    into this function before or below “bbp_notify_topic_subscribers” and write a var_dump to a separate file, the topic-id is still inside the topic-id-array during the publish process ( {old}_to_{new} ).

    But if I var_dump this array directly afterwards (frontpage: page reload –> wp_footer ), the id isn’t still in there (email fails if I post with another user).

    It seems that anything erase this specific topic-id for this specific reply-author between publish and the next page load. All other topic-ids are still in this array..?

    To add it manually to the hook ‘publish_reply’ with this bbp-function doesn’t work:

    bbp_add_user_topic_subscription( $reply_author_id, $topic_id );

    Has anybody an idea why this can happen?

    As long as the reply isn’t publish, everything works right with the subscription. It’s also possible to manually add this user to this specific topic after the reply is published. But if this user send a new post for this topic, the topic-id is erased inside the subscription array after publishing..

    No caching is active…

    #163350
    Robkk
    Moderator

    Enable Visual Editor

    TinyMCE Advanced allows you to include alignment buttons.

    You might need this code, because bbPress does not support all html for participant users that TinyMCE Advanced may use for its buttons.

    https://gist.github.com/robkk/788f75d47466c74e5340

    Robkk
    Moderator

    trying to get the feature image funtionality on front end so user can have the option to upload image about the Topic

    This sounds like custom development , you might need a developer to do this type of thing.

    get the feature image on Widget “Forum list” Default widget of BbPress plugin

    You would need to create a new “Forums list” widget mostly based off the original bbPress default widget.

    Then use get_the_post_thumbnail to render your featured images

    https://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
    https://codex.wordpress.org/Post_Thumbnails

    #163342
    Robkk
    Moderator

    This is a common issue. Your theme is just rendering bbPress as a blog post

    You need to create a bbpress.php for your site to fix this.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #163341
    Prabin
    Participant

    Hi there,

    I am using both bbPress and buddyPress plugins in my site and I want this feature:

    any logged in user can vote to the topics/replies and using shortcode or any trick, I want them
    to show-up in certain page. I looked up most of the plugins in wordpress but couldn’t find my match.

    Any help ?

    ashu2106
    Participant

    i m trying to get the thumbnail of topic to show on Widget “Forum list”
    what i m trying to achieve are

    1. trying to get the feature image funtionality on front end so user can have the option to upload image about the Topic
    2. get the feature image on Widget “Forum list” Default widget of BbPress plugin

    i m not developer, as i have feature image in admin using some code found here.
    Please provide some suggestions

    looking for quick reply, as i have to use this feature in website.
    thanks

    #163335
    Robin W
    Moderator

    the code should still work.

    Try

    https://wordpress.org/plugins/bbp-style-pack/

    there is a setting in forum display that should do the same function

    #163332
    sanjaynakate
    Participant

    Finally i have got the answer.
    Bellow are the step.
    1) Get user current user id.

    <?php $user_id = get_current_user_id(); ?>

    2)set new user forum role you wish to change

    <?php $new_role_forum_role="bbp_participant"; ?>

    3)fire function.

    <?php bbp_set_user_role( $user_id, $new_role_forum_role );?>

    now check your user in back end and see forum user role.

    Full snippet code

    <?php
    $user_id = get_current_user_id();
    $new_role_forum_role=”bbp_participant”;
    bbp_set_user_role( $user_id, $new_role_forum_role );
    ?>

    #163329
    u_Oi
    Participant

    Hi People!

    Please, some help to solve this:

    1. I would like to have the code to center text, images, and things in the editor of bbpress. Any idea? (If i write <center></center> in the editor the text after the code change their size :/ ).

    2. Simple, how can i add a double space to text in the editor? (if i tap a double enter, it should show a double space)

    Wordpress 4.2.2
    Bbpress 2.5.7

    Thank You!

    #163320
    subz
    Participant

    What is the shortcode for listing all topics belonging to two or more forums (multiple forum ids)??

    #163318
    lisigef
    Participant

    I copied the code in https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#16-adding-description-to-forum-pages but there seems to be a problem with it and I’m just getting a blank page when I try to view the forum (When I comment out the code, the page shows up again, but of course without the description).

    I added the code to functions.php – is it supposed to go somewhere else? IS there some update needed to this code, given that it is a year later?

    Thanks in advance!

    #163310
    nap14hockey
    Participant

    When I use the bbpress index shortcode, it shows only the first 3.5 forums (notice I said 3.5 because the 4th one only the title is shown. I have 7 forums, and I need them to display on the forums page?

    Thanks
    Nap14hockey

    #163299
    project_subdomain
    Participant

    thanks, sam. tried several codes, nothing worked unfortunately (blank page):(

    add_action( 'loop_start', 'divs_only_when_logged_in' );
    
    function divs_only_when_logged_in() {
    
    <?php if ( is_user_logged_in() ) {?>
     
        <div class="new-reply-link">
    
    	<a href="<?php bbp_topic_permalink(); ?>#new-post
    "class="reply-link-text">Reply</a> 
        </div></br>
    
    <ul id="bbp-topic-<?php bbp_topic_id(); ?>-lead" class="bbp-lead-topic">
    
    	<li class="bbp-header">
    
    		<div class="bbp-topic-author"><?php  _e( 'Author',  'bbpress' ); ?>
    </div>
    
    <?php endif; ?>
    }  
    ?>
    #163291
    Sam Rohn
    Participant

    try the wp “is_user_logged_in” function

    https://codex.wordpress.org/Function_Reference/is_user_logged_in

    <?php
    if ( is_user_logged_in() ) {
    	echo 'Welcome, registered user!';
    } else {
    	echo 'Welcome, visitor!';
    }
    ?>

    or

    <?php if ( is_user_logged_in() ) { ?>
    <p>Welcome logged in user<p>
    <?php endif; ?>

    sam

    #163290
    project_subdomain
    Participant

    Hi,
    is there anyone who can help me to get this part

    <div class="new-reply-link">
    
    	<a href="<?php bbp_topic_permalink(); ?>#new-post
    "class="reply-link-text">Reply</a> 
    </div></br>
    
    <ul id="bbp-topic-<?php bbp_topic_id(); ?>-lead" class="bbp-lead-topic">
    
    	<li class="bbp-header">
    
    		<div class="bbp-topic-author"><?php  _e( 'Author',  'bbpress' ); ?>
    </div>
    
    <!-- .bbp-topic-author -->
    

    into an if-statement for logged in users?

    I suppose that
    <?php if ( bbp_is_user_logged_in() ) { ... } ?>
    does not work that simple due to the additional php within, right?
    (no success so far..)

    #163284
    Robkk
    Moderator

    This custom function should remove the “forums” in the breadcrumbs.

    Put it in your child theme functions.php or a functionality plugin to place custom code snippets.

    function rkk_custom_bbpbreadcrumbs() {
        // Remove Forum root from bbPress breadcrumbs
        $args['include_root']    = false;
        return $args;
    }
    
    add_filter('bbp_before_get_breadcrumb_parse_args', 'rkk_custom_bbpbreadcrumbs');
    #163283

    In reply to: Lestify

    Robkk
    Moderator

    your theme thinks bbPress is a blog post.

    usually modifying the main bbPress template will help fix this.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #163274
    Robin W
    Moderator
    #163269
    Robkk
    Moderator

    I meant remove the <pre>

    #163267
    Sktella
    Participant

    Sorry, I just retyped my problem. I forgot to encode the error code.

    Hi,
    I expect to add a Login/Logout to the menu,however,I encountered this syntax error (indicating in the title) while editing the theme functions.php. According to the error message,
    $loginlink = '</pre><ul><li><a title='Logout' href="'.$url2.'">Logout</a></li></ul><pre>';
    is the code causing this parse error.
    Since this code is provided in the documentation and works fine for others, I wonder what the problem is.
    Hope you can help. Thank you so much!

    #163266
    Sktella
    Participant

    Hi,

    I expect to add a Login/Logout to the menu,however,I encountered this syntax error (indicating in the title) while editing the theme functions.php. According to the error message,

    $loginlink = ‘

    ';
    
    is the code causing this parse error. 
    
    Since this code is provided in the documentation and works fine for others, I wonder what the problem is.
    
    Hope you can help. Thank you so much!
    
    #163257

    In reply to: Change colour

    Robkk
    Moderator

    you still have an issue??

    usually people forget the <?php at the start of the functions.php file in their child theme?? if that is it.

    You can also just create a new one then see what code is screwing up your site.

    #163252
    Robkk
    Moderator

    Just shy away from using shortcodes for forum pages , it will be time consuming. You would have to possibly create pages for all instances of any bbPress page. This includes topic pages and user profile pages.

    The way you could get a non-fullwidth layout is to contact your theme author , which I think is Avada for help. Since they have more knowledge of how the theme works and I can’t just buy a theme and test it out and tell you what to do to have this layout.

    You could also do this manually with my help guiding you, but you would need some basic knowledge of how WordPress templates work.

    This guide will help with getting the layout , you would need to add the sidebar code back in like how the example template has. Please note that that is just an example template and is not something to copy and paste since all themes are different.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

Viewing 25 results - 8,501 through 8,525 (of 32,508 total)
Skip to toolbar