Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,776 through 6,800 (of 32,505 total)
  • Author
    Search Results
  • oyegigi
    Participant

    Hey y’all. I’m trying to import a bbpress forum from one site to another and am experiencing troubles getting my replies to show up. I’ve imported .xml files for my forum, topics, and replies (I had to separate out my replies into batches bc it was so large). In my admin section it shows that there are 442 published replies however none show up on the table. I’ve tried “Recalculate the position of each reply” in Repair Forums but get a blank screen every time.

    I tried increasing my execution time in .htacess by adding php_value max_execution_time 900 and still nothing.

    Any suggestions on how I can get this replies to show up? Thanks!

    #172573
    Robkk
    Moderator

    Use this custom CSS and add it to your child themes style.css file or in a custom css plugin.

    .the_champ_outer_login_container {
        float: left;
    }
    
    div.bbp-submit-wrapper {
        float: none;
    }
    #172557
    Pascal Casier
    Moderator

    Hi,
    Not sure if 100% related, but if you know a little bit of coding, you can also check this : https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#6-load%c2%a0the-style-sheet-after-bbpress
    Pascal.

    #172533
    Robin W
    Moderator

    ok, so as I understand it

    fro each topic/reply, you want the widget to search for then first video/picture within that topic or reply, and show that as a thumbnail – is that correct?

    If so I know of nothing that would do that, and it would be quite a lot of code to create it.

    #172532
    Lars Henriksen
    Participant

    Hello,

    I have found a code snippet somewhere, that does a fine job by including forum topics in the ordinary WP search. The only problem is that I have now added some private forums on the site where teachers can share assignments and problem statements for use in class.

    So I would like to exclude private forum topics and replies from search results unless you are logged in as ‘contributor’ and up.

    Does anybody know how to code that?

    My code snippet is here:

    /**
     * Include bbPress 'topic' custom post type in WordPress' search results */
     
    function ntwb_bbp_topic_cpt_search( $topic_search ) {
    	$topic_search['exclude_from_search'] = false;
    	return $topic_search;
    }
    add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
    
    /**
     * Include bbPress 'forum' custom post type in WordPress' search results */
    
    function ntwb_bbp_forum_cpt_search( $forum_search ) {
    	$forum_search['exclude_from_search'] = false;
    	return $forum_search;
    }
    add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' );
    
    /**
     * Include bbPress 'reply' custom post type in WordPress' search results  */
    
    function ntwb_bbp_reply_cpt_search( $reply_search ) {
    	$reply_search['exclude_from_search'] = false;
    	return $reply_search;
    }
    add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' );
    
    

    Thanks.

    Current WordPress and bbPress

    Historielaerer.dk (a site for history teachers)

    #172525
    pwonlineblog
    Participant

    I installed WordPress as an add-on to my webpage with Aabaco Small Business (formerly Yahoo), so I don’t have folders downloaded on my computer to access code. I want to make a couple of changes to the “Reply To” form in my forums. One box asks for “Mail” and I’d like to change that to “Email” to make it more understandable. I’d also like to eliminate the box for “Website” if possible since it wont be applicable to the people who will be responding on my forum.

    I’m not all that experienced with coding, but I have done a little of it on my website and I’m good at following directions! Is it possible to make these changes since I don’t have WordPress as a stand alone?

    #172524
    Robkk
    Moderator

    @nicolasmahy

    Yeah the responsive styles in bbPress use .bbp-body which is having the issue here. But since you customized and removed the labels in the header of the forums you can try this custom CSS and see if it helps any.

    @media screen and (max-device-width: 480px) {
    #bbpress-forums div.bbp-forum-content, 
    #bbpress-forums div.bbp-topic-content, 
    #bbpress-forums div.bbp-reply-content {
        margin-left: 0px;
        padding: 12px;
    }
    
    #bbpress-forums div.bbp-forum-author,
    #bbpress-forums div.bbp-topic-author,
    #bbpress-forums div.bbp-reply-author {
        float: none;
        text-align: center;
        width: 100%;
    }
    
    #bbpress-forums div.bbp-forum-author a.bbp-author-name, 
    #bbpress-forums div.bbp-topic-author a.bbp-author-name, 
    #bbpress-forums div.bbp-reply-author a.bbp-author-name {
        margin: 0;
        word-break: break-word;
        display: block;
    }
    }
    #172519
    Pascal Casier
    Moderator

    Hi,
    What bbPress forum did you create ? So if you edit your forum /wp-admin/edit.php?post_type=forum is the ‘visibility’ under ‘Forum Attributes’ set correctly ? Try to switch it if needed with an ‘update’ in between.
    Pascal.

    #172518
    Pascal Casier
    Moderator

    Hi, I’m sorry but I have no idea what you try to do, but as you talk about forums and subforums without forums, you might mean that you want an extra level ?
    Maybe you look for Categories > Forums > Subforums ?
    Then look at https://codex.bbpress.org/getting-started/configuring-bbpress/creating-content/#creating-a%c2%a0forum

    If not, just come back and explain again.

    Pascal.

    #172516
    angeljs
    Participant

    I’m running a WordPress Multisite install and have bbPress setup on the main site. However, logged-in users can’t access the main forum. Admins and guests can see them, which doesn’t seem to make sense. Users can see group forums, but not the main page, they just get a page not found error. I’ve even tried creating the forums page and adding the shortcodes, but still get the same error.

    New users are supposed to have the participant roll, which I’ve checked. I’ve also tried repairing the forums, but nothing works.

    #172512
    Brovashift
    Participant

    Hi anyone and everyone,

    Im just wondering why bbpress displays participants real name instead of their username by default? I want to change this as I can’t remember ever seeing a site before where you create a username for it not to be used, even this bbpress support forum shows usernames!

    I see topics on this matter going back 4+ years, and still its the same solution, why?

    So why is it that we have to edit code to achieve this? It should at least be a simple edit in the admin area.

    #172510
    leev
    Participant

    Hello, I’m looking for a way to hide something that will be with the <?php bbp_forum_freshness_link(); ?>. Whenever there’s a topic for the forum, <?php bbp_forum_freshness_link(); ?> will display a link. If there’s no topic in the forum or it’s empty, then there will be no link. How do I add the same function to some custom added codes.

    Examples, I’m looking for something like this:

    <?php don’t display if there’s no topic or it’s empty ?>
    topic title
    by author
    <?php bbp_forum_freshness_link(); ?>

    <?php endif;?>

    #172508
    selenii
    Participant

    How can I edit this code

    	<?php if ( bbp_has_forums() ) : ?>
    
    		<?php bbp_get_template_part( 'loop',     'forums'    ); ?>
    
    	<?php else : ?>
    
    		<?php bbp_get_template_part( 'feedback', 'no-forums' ); ?>
    
    	<?php endif; ?>

    I will put forums on all forum pages, because in the subforum I have not any forums.

    #172489

    In reply to: add a specific class

    Robkk
    Moderator

    You can also use this PHP function to add a class to the forum instead of doing it manually.

    function rkk_add_forum_classes( $classes ) {
     $classes[] = 'class';
     return $classes;
    }
    add_filter( 'bbp_get_forum_class','rkk_add_forum_classes' );

    Now I would like to change while loop_forums in index forums on loop-forums.php

    I do not know exactly what you are trying to do, but for just customizing it you can put the loop-forums.php file in a child theme in a folder called bbpress and then customize the file to your liking.

    https://codex.wordpress.org/Child_Themes

    #172486
    Robkk
    Moderator

    @selenii

    1. Are you using the plugin bbPress moderation?? This plugin has a feature to confirm each topic or reply submitted by users.
    2. Do you have anything in your comment blacklist in Settings > Discussion?? bbPress uses this comment blacklist for its topics and replies and this could mark the posts as pending until approval.

    Sometimes plugins can add words to this comment blacklist, and sometimes a host can install a plugin that may have its own comment blacklist words that you may not be aware of is installed because it may be installed in the root of your site.

    Do these posts you are approving have any foul language?? Because that is usually the words in these comment blacklists.

    #172485
    stewmills
    Participant

    Unfortunately that didn’t work. I switched the code and while it still included a sidebar with stuff, it was a sidebar with all sorts of crazy stuff about a page long.

    So, I acted as if I was starting over and I copied my page.php file and resaved it as bbpress.php in my main theme folder. The result of this was a page with no sidebar anywhere in my forum since this template does not include any sidebar info.

    So do I:
    a) keep the page.php file that I renamed to bbpress.php and just add some code (I would need directions) to include the sidebar on all bbpress pages.
    b) revert back to my previous page an keep troubleshooting this issue with the page template that i know works aside from the topics page.

    Here is the code from the page.php page that I renamed to bbpress.php, which looks great but does not display my sidebar on any forum page.

    <?php get_header(); ?>
    
    <?php 
    // check for WooCommerce. If true, load WooCommerce custom layout
    if (class_exists('woocommerce') && ((is_woocommerce() == "true") || (is_checkout() == "true") || (is_cart() == "true") || (is_account_page() == "true") )){ ?>
    
    </div><!-- header-area -->
    </div><!-- end rays -->
    </div><!-- end header-holder -->
    </div><!-- end header -->
    
    <?php truethemes_before_main_hook(); //action hook ?>
    
    <div id="main" class="tt-woocommerce">
    <?php get_template_part('theme-template-part-tools-woocommerce','childtheme'); ?>
    
    <div class="main-holder">
    <div id="content">
    <?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile; endif; 
    comments_template('/page-comments.php', true); ?>
    </div><!-- end content -->
    
    <div id="sidebar" class="right_sidebar">
    <?php 
    		if ( (is_cart() == "true") || (is_checkout() == "true") ) {
    			dynamic_sidebar("WooCommerce - Cart + Checkout");
    		} else {
    			dynamic_sidebar("WooCommerce Sidebar");
    		}
    		?>
    </div><!-- end sidebar -->
    </div><!-- end main-holder -->
    </div><!-- main-area -->
      
      
      <?php // ELSE load default layout
      } else { ?>
      
    </div><!-- header-area -->
    </div><!-- end rays -->
    </div><!-- end header-holder -->
    </div><!-- end header -->
    
    <?php truethemes_before_main_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    
    <div id="main">
    
    <?php get_template_part('theme-template-part-tools','childtheme'); ?>
    
    <div class="main-holder">
    <div id="content" class="content_full_width">
    <?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile; endif; 
    comments_template('/page-comments.php', true);
    get_template_part('theme-template-part-inline-editing','childtheme'); ?>
    </div><!-- end content -->
    </div><!-- end main-holder -->
    </div><!-- main-area -->
      
      
      <?php // END WooCommerce loop
      } ?>
        
    <?php get_footer(); ?>

    Thanks!

    #172484
    stewmills
    Participant

    Ok, so the code above is from your page.php file saved as bbpress.php in your theme – yes?

    NO, and that may be the issue? What I did is copy one of my other theme pages that I know included a sidebar, let’s just call it “page-with-leftsidebar.php”. I copied this page into my child folder and renamed it bbPress.php and that’s the code I posted above.

    I can gladly try your suggestion above, but could it be that I used the wrong page to create my bbPress.php file? I did install the “What The File” plugin and when I look at what page my forum points to, including new topics, they all show bbpress.php as the main page with other things listed in the Template Parts section.

    Anyhow…let me try your suggestion above with that piece of code and report back before i have you on an wild goose chase for no reason.

    Thanks!!! Will report back shortly.

    #172483
    Robin W
    Moderator

    The “blank space” where it goes is still there, it just does not display.

    Great – that was the bit of information I was after.

    Ok, so the code above is from your page.php file saved as bbpress.php in your theme – yes?

    If so then try changing

    <?php generated_dynamic_sidebar(); ?>
    

    to

    <?php get_sidebar(); ?>
    

    This may not work, I’m just guessing at how your theme is designed !

    #172481
    stewmills
    Participant

    Robin (thanks for always coming to my rescue),

    Everything on the page is good except the sidebar is missing. I can add it via dashboard if I edit the topic, but I cannot do this every time someone posts a new topic. All other pages have the sidebar.

    I tried to move my bbpress.php to the main theme directory to ensure that it was picking up this page before any other page and that changed nothing. I then thought maybe there was code in my page.php file from the initial load of bbpress that it might be looking for so I copied the page.php file from my theme and resaved it as bbpress.php and still no difference.

    I don’t really care that my forum is exactly like the layout of my other site pages so I am ok with some variation. My only requirements would be that (1) I can keep the header menu for navigation back to my main site and (2) I have the sidebar on any bbpress forum pages, specifically new topics in this situation.

    Forgive me for rambling, just trying to offer what I have tried and as well my flexibility.

    Would it be better for me to just make a new page template and tell it to pull in the sidebar on all pages versus using a template from the theme that included a sidebar?

    I am open to suggestions, but might need to be spoon fed a little to ensure I am following all of the appropriate steps.

    Many thanks!

    Pascal Casier
    Moderator

    Hi,

    Sure there is: https://codex.bbpress.org/features/reply-threading/

    Please note the bottom 2 small ‘issues’.

    Pascal.

    #172473

    In reply to: add a specific class

    neecride
    Participant

    Thank you !

    I found the file in part !!

    Now I would like to change while loop_forums in index forums on loop-forums.php

    exemple : http://gauge.wpengine.com/forums/

    i does not use shortcode I create a forum page and i edit the default page in bbpress folder on my folder template !

    translated by google !!

    #172461

    In reply to: bbp_new_forum hook

    Antipole
    Participant

    Thanks – yes – stupid error. It is always amazing what a fresh eye brings.
    Things started working then and I checked all my numerous trace actions and it is now working well. Here is the final version for your interest.

    thanks a million, Tony

    // (2)	When a new forum is created, all current users are automatically subscribed to it
    
    //	Note status of forum entry at start of any update
    function ovni_pre_post_update_status($forum_id){
    	if (bbp_is_forum($forum_id)) {
    		global $ovni_forum_old_status;
    		$ovni_forum_old_status = bbp_get_forum_visibility($forum_id);
    		}
    	}
    add_action('pre_post_update', 'ovni_pre_post_update_status');
    
    function ovni_subscribe_users_to_new_forum($forum_id){  // subscribe all users to a new forum unless it is a group forum
    	if (bbp_is_forum($forum_id)){
    		if (bbp_get_forum_parent_id( $forum_id ) == 969) return;  // if this is group forum, do nothing
    		global $ovni_forum_old_status;
    		if (in_array($ovni_forum_old_status, array(NULL, 'auto-draft', 'draft'))){
    			// forum has just been published
    			$all_user_ids = get_users();
    			foreach ($all_user_ids as $this_user){
    				bbp_add_user_forum_subscription($this_user->id, $forum_id);
    				}
    			}
    		}
    	}
    add_action('bbp_forum_attributes_metabox_save', 'ovni_subscribe_users_to_new_forum');
    
    #172457

    In reply to: bbp_new_forum hook

    Antipole
    Participant

    Thanks @fterra for your suggestions.
    I cannot see that my action on pre_post_update is firing at all, even if I edit an existing forum. I have trace actions in and neither user 33 or 32 are getting subscribed.
    Puzzled.

    function ovni_pre_post_update_status($forum_id){
    	bbp_add_user_forum_subscription(33, $forum_id);	// debug **********
    	if (bbp_is_forum($forum_id)) {
    		global $ovni_forum_old_status;
    			bbp_add_user_forum_subscription(31, $forum_id);	// debug **********
    		$ovni_forum_old_status = bbp_get_forum_visibility($forum_id);
    		}
    	}
    add_action('pre_post_update', 'ovni_pre-post_update_status');
    #172453

    In reply to: bbp_new_forum hook

    fterra
    Participant

    This would be more appropriate:

    function my_pre_post_update_hook($post_ID) {
    	if (bbp_is_forum($post_ID)) {
    		global $my_forum_old_status;
    		$my_forum_old_status = bbp_get_forum_visibility($post_ID);
    	}
    }
    add_action( 'pre_post_update', 'my_pre_post_update_hook' );
    #172452

    In reply to: bbp_new_forum hook

    fterra
    Participant

    This is funny.
    I found out that pre_post_update hook – which at first sight seemed to fire only when updating – will fire if the post (or forum) has already been auto-saved AS A DRAFT.
    Similarly I have also been surprised that “save_post_{$post->post_type}” third parameter $update will always be true after it’s first auto-saved AS A DRAFT.
    So to know if it’s a new forum (or post), I guess you have to check its previous status. For new posts the previous status will be either ‘auto-draft’, ‘draft’ or I guess it’s also possible there will be no previous status yet.

    So you can do something like hook to pre_post_update and store its current (which soon in the same request will become “previous”) status. Like this:

    function my_pre_post_update_hook($post_ID) {
    	global $my_forum_old_status;
    	$my_forum_old_status = bbp_get_forum_visibility($post_ID);
    }
    add_action( 'pre_post_update', 'my_pre_post_update_hook', 10 );

    So in your bbp_forum_attributes_metabox_save action you can check if it’s a new forum with something like:

    	global $my_forum_old_status;
    	if (in_array($my_forum_old_status, array(NULL, 'auto-draft', 'draft')))

    Warning – this condition is enough because when bbp_forum_attributes_metabox_save action is fired we know the forum’s current status will not be any of these.

    I guess you could also do it with the transition_post_status hook, whose arguments are: $new_status, $old_status, $post.

Viewing 25 results - 6,776 through 6,800 (of 32,505 total)
Skip to toolbar