Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,276 through 2,300 (of 32,508 total)
  • Author
    Search Results
  • #215532
    dasr94
    Participant

    i have a website with elementor, astra, learndasg and bbpress, when i do a new replie from a topic i dont have problem that show the replie like a thread but in a other page that have inserted the topic with shortcode i dont add a new replies like a thread, appears like a new replie, i can show images if you want

    mkbond
    Participant

    Hello, there!

    We work with BuddyBoss but with a primary focus on forums/topics with bbPress.

    So I’m having issues with the hierarchy of forums and discussions and… I’m trying to have a page for each forum — with all of the discussions listed as a post grid (not BuddyBoss’ Forum Grids, need this to vary from page to page). So with regards to taxonomy and filters, I want to have the parent category defined as a particular forum, and the children categories to be the discussion within that same forum. Example: Need different pages for Recipes, and need a page for Desserts (forum) that shows all the different desserts (discussions/topics), not showing all the other forums (Desserts, Main Dishes, etc.) and their discussions (turkey, asparagus, etc).

    I’ve been playing with Beaver Builder and Gutenberg blocks, but it seems that some plugins have issues reading Custom Post Types, which is what forums and discussions/topics are. And the ones that can, like Beaver Builder, will only let you show the Post Type as Forums, and then you can filter to what forums you want to show, but if you only pick one, then it’s just one lone block. And if I set the Post Type to Discussions, then I have to list each discussion, one by one to display on the page (so each time someone creates a new topic/discussion, it would have to be added to this list).

    We are currently using Beaver Builder but I’m definitely open to other ideas for this. Here’s the Beaver Builder post I made if any of you are familiar with it: Standard Posts Module to Display Category’s Sub-Categories (Child)

    Any ideas or methodologies? I have a web app dev background and am not afraid to modify the functions.php or other files on the backend. See below for what I attempted based on Beaver Builder’s documentation. The second argument for ‘post_parent’ didn’t take, but the post_type did, if I’m not mistaken… leadershipx being the id for the Posts module, but I’ve been looking into wp_query as well (never coded anything yet with wp_query, but happy to learn).

    function fl_builder_loop_query_args_filter( $query_args ) {
      if ( 'leadershipx' == $query_args['settings']->id ) {
        $query_args['post_type'] = array( 'topic' );
        $query_args['post_parent'] = array( '4773' );
      }
      return $query_args;
    }
    add_filter( 'fl_builder_loop_query_args', 'fl_builder_loop_query_args_filter' );

    WordPress v5.5.1, BuddyBoss v1.5.3 (I don’t know where to find bbPress version inside BuddyBoss, but we have the most up-to-date version of BuddyBoss, so I would assume it’s the most recent version of bbPress)

    Site: https://www.mycionetwork.com/

    #215485
    Robin W
    Moderator

    just tried that code on my test site and it works fine.

    where are you putting it ?

    #215482
    Robin W
    Moderator

    ok, try this

    add_filter( 'bbp_before_has_search_results_parse_args' , 'my_bbp_filter_search_results' );
    
    function my_bbp_filter_search_results( $args ){
        $forum_id = 1715;
    
        if( $forum_id && is_numeric( $forum_id ) ){
     
           $args['post_parent'] = $forum_id ;
        }
    
        error_log('Dedicated forum = ' . $forum_id);
     
        return $args;
    }
    
    #215479
    talbotp
    Participant

    Hey Robin, Thanks for the reply, really appreciate it. I added this to my themes functions.php (from the article above), but hardcoded in a forum_id, just to test it out, and it doesn’t seem to work.

    
    function my_bbp_filter_search_results( $r ){
        $forum_id = 1715;
    
        if( $forum_id && is_numeric( $forum_id ) ){
     
            $r['meta_query'] = array(
                array(
                    'key' => '_bbp_forum_id',
                    'value' => $forum_id,    // 1715 x , 11 , 1717 , 
                    'compare' => '=',
                )
            );
             
        }
    
        error_log('Dedicated forum = ' . $forum_id);
     
        return $r;
    }
    add_filter( 'bbp_after_has_search_results_parse_args' , 'my_bbp_filter_search_results' );
    

    the error log is coming through when the page is loaded, but i’m still getting discussions from other forums in the search results.

    #215472
    Robin W
    Moderator

    from a very quick look, that code looks like it should work, and not seen anything else that does this, so try it, and if it doesn’t work, come back

    Robin W
    Moderator

    your theme or elementor is doing this

    it has a css entry

    .has-sidebar:not(.error404) #primary {
    	float: left;
    	width: 58%;
    }

    you could change this to 100% in your custom css ie put this in your custom css

    .has-sidebar:not(.error404) #primary {
    	width: 100% !important;
    }

    but it might affect other parts of your site, so try it and see

    #215470
    Robin W
    Moderator
    #215469
    Robin W
    Moderator

    sorry, this one slipped by

    add this code, changing ‘shortcode here’ to the actual shortcode you wish to execeute

    add_action( 'bbp_theme_before_reply_form' , 'rew_add_shortcode'); 
    
    function rew_add_shortcode () {
    	echo do_shortcode( '[shortcode here]' );
    }

    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

    truth4vahid
    Participant

    How can I insert short codes under/above each topic page or whole topic and reply page?

    #215457

    In reply to: Customization

    wenlu
    Participant

    Can I fix the problem by changing its codes in the specific files ?
    If yes, due to I’m a new to WordPress, I don’t even know where should I edit the code.

    #215448

    In reply to: Customization

    Robin W
    Moderator

    this still works as far as I know

    How to Add WordPress Conditional Content to Sidebar Widgets

    so you would use

    !is_bbpress()

    against the my posts – so that will only show on non bbpress pages

    #215442
    samtime
    Participant

    Hi Robin, thank you for the code.
    I replaced my existing code with what you pasted here, unfortunately it didn’t fix the issue.
    Tried replacing the “WooCommerce” part with “woocommerce”, but still no luck.

    Thanks for the reply. If you have any other ideas, it would be greatly appreciated.
    I’ll keep searching.

    Thanks again,
    Sam

    Here’s the website btw:
    https://funkytime.tv/forums/

    cgauthey
    Participant

    Hello,
    I have a problem here my forum is small when I look at it on the index I would like to take the full width of the page.

    How to do what code I will be able to enter in the CSS

    See here https://perso-blog.fr/buisness-strategie/forums/

    #215425
    Robin W
    Moderator

    there are several plugins that do this eg

    CB Change Mail Sender

    or you can google for code

    #215413
    Robin W
    Moderator

    ok, a couple of thoughts just looking at that code

    The first would be to break it into a function, nested stuff can sometimes fail so

    add_action('init', 'rew_check_bbpress_moderator') ;
    
    function rew_check_bbpress_moderator(){
    	if(class_exists('WooCommerce') && function_exists('bbp_get_user_role') && is_user_logged_in()){
    		$current_user = wp_get_current_user();	
    		$user_id = $current_user->ID;	
    		$bbp_get_user_role = bbp_get_user_role($user_id);
    
    		if($bbp_get_user_role == 'bbp_keymaster' || $bbp_get_user_role == 'bbp_moderator'){	
    			add_filter( 'woocommerce_prevent_admin_access', '__return_false' );
    			add_filter( 'woocommerce_disable_admin_bar', '__return_false' );
    		}
    	}
    }

    Secondly I think woocommerce is all lower case so

    if(class_exists('WooCommerce')

    might need to read

    if(class_exists('woocommerce')

    Let us know if either of these help

    #215402
    samtime
    Participant

    Hi,
    After updating WooCommerce to the latest version (4.6.1), the plugin is now hiding the WordPress admin bar for bbPress moderators and keymasters. Making it harder for them to moderate the forums.

    The following code in my functions.php file used to resolve the issue, however it no longer works:

    add_action('init', function(){
    if(class_exists('WooCommerce') && function_exists('bbp_get_user_role') && is_user_logged_in()){
    
    $current_user = wp_get_current_user();	
    $user_id = $current_user->ID;	
    $bbp_get_user_role = bbp_get_user_role($user_id);
    
    if($bbp_get_user_role == 'bbp_keymaster' || $bbp_get_user_role == 'bbp_moderator'){	
    add_filter( 'woocommerce_prevent_admin_access', '__return_false' );
    add_filter( 'woocommerce_disable_admin_bar', '__return_false' );
    }
    }
    });

    I posted this question to the WooCommerce forums and am also posting it here in case anyone else is having similar problems?

    Any help or ideas greatly appreciated.
    Thank you,
    Sam

    WordPress 5.5.1
    bbPress 2.6.5
    WooCommerce 4.6.1

    #215351
    josh.grisdale
    Participant

    Hi,

    Looking for the same thing, but to show subscribed forums…

    Can your code be changed for that?

    #215344
    josh.grisdale
    Participant

    Hello,

    I want to create a widget for the sidebar of my site that shows the current user’s subscribed forums. (Like when you go to the user profile, you can see a list of subscribed forums, I want to have that list in a sidebar widget.)

    Is there a shortcode that could do this? Like:
    [bbp-forum-index id=$subscribed]

    #215260
    matgargano
    Participant

    I see that bbp_get_user_rewrite_id() exists, but there’s no filter in it. Is it possible to override that and have it use display name?

    matgargano
    Participant

    Hi, currently the user slug for my site is:

    https://domain.com/forums/users/first-last/ (it may not be exactly first-last, but it’s not what i ultimately want it to be).

    I want that to be: https://domain.com/forums/users/{display-name}/

    and it to change if the user changes their display name (301s aside, let’s not worry about old links to their profile that may exist)

    Is this possible out of the box? or via some method (code, plugin, etc)

    #215249
    Robin W
    Moderator

    try adding this to your theme’s custom css, or the custom css tab of style pack

    .mce-ico {
    	background: transparent center center !important;
    	color: #595959 !important;
    }

    you might need to play with the color to get what you want

    #215241
    albertoe
    Participant

    Thanks Robin, I check that a bbpress.php was created with this code:

    <?php
    get_header();
    
    ?>
    
    	<div class="td-main-content-wrap td-main-page-wrap td-container-wrap">
    		<div class="td-container">
    			<div class="td-pb-row">
                    <div class="td-pb-span8 td-main-content">
                        <div class="td-ss-main-content">
                            <?php
                                if (have_posts()) {
                                    while ( have_posts() ) : the_post();
                                        ?>
                                        <h1 class="entry-title td-page-title">
                                            <a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>
                                        </h1>
                                        <?php
                                        the_content();
                                    endwhile; //end loop
                                }
                            ?>
                        </div>
                    </div>
                    <div class="td-pb-span4 td-main-sidebar">
                        <div class="td-ss-main-sidebar">
                            <?php dynamic_sidebar( 'td-default' ) ?>
                        </div>
                    </div>
    			</div> <!-- /.td-pb-row -->
    		</div> <!-- /.td-container -->
    	</div>
    <?php
    get_footer();
    ?>

    And I change with for this code:

    <?php
    get_header();
    
    ?>
    
    	<div class="td-main-content-wrap td-main-page-wrap td-container-wrap">
    		<div class="td-container">
    			<div class="td-pb-row">
                    <div class="td-pb-span8 td-main-content">
                        <div class="td-ss-main-content">
                            <?php
                                if (have_posts()) {
                                    while ( have_posts() ) : the_post();
                                        ?>
                                        <h1 class="entry-title td-page-title">
                                            <a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>
                                        </h1>
                                        <?php
                                        the_content();
                                    endwhile; //end loop
                                }
                            ?>
                        </div>
                    </div>
    			</div> <!-- /.td-pb-row -->
    		</div> <!-- /.td-container -->
    	</div>
    <?php
    get_footer();
    ?>

    I refresh cache but nothing happends. Any idea?

    #215240
    Robin W
    Moderator
    #215221
    Robin W
    Moderator

    bbpress just uses wordpress signup, so whatever your WordPress site is using.

    There are several plugins that will let you change this email eg

    https://www.wpbeginner.com/plugins/how-to-send-a-custom-welcome-email-to-new-users-in-wordpress/

    or if you’re into coding, just google around to find some code

Viewing 25 results - 2,276 through 2,300 (of 32,508 total)
Skip to toolbar