Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,851 through 7,875 (of 32,522 total)
  • Author
    Search Results
  • #166839
    guillaumemolter
    Participant

    Thank you! I did the same…copy pasted the shortcode from this page! And was desperatly trying to find how to remove this non-html5 tag from bb-press!

    You saved my day!

    #166838
    Robkk
    Moderator

    There is a way to put it into a specific menu if you know exactly what the theme location or any additional menu arguments of a specific menu are.

    Here is an example if the theme location is primary.

    add_filter('wp_nav_menu_items','rk_bbp_menu_profile_link', 10, 2);
    function rk_bbp_menu_profile_link( $items, $args ) {
        if( is_user_logged_in() && $args->theme_location == 'primary')  {
    		
    	$current_user = wp_get_current_user();
            $user = $current_user->user_nicename;
    	$profilelink = '<a href="/forums/users/' . $user . '/">Your Profile</a>';
            $items .=  '<li>' . $profilelink .  '</li>';
    
    	}
        return $items;
    }
    #166837
    Kasi Salyer
    Participant

    Hi,

    Here is what I see using codestyling localisation :

    Loading Issue: Author is using load_textdomain instead of load_plugin_textdomain function. This may break behavior of WordPress, because some filters and actions won’t be executed anymore. Please contact the Author about that.

    Thanks.

    #166835
    Robkk
    Moderator

    Haha! I did not even edit/create this page before. 🙂

    Alright, thanks for pointing that out. I just now changed the errors you pointed out for now, but this guide might be completely rewritten later because it does contain information that is similar to/that should be in the theme compatibility guide.

    Theme Compatibility

    And it kind of has information that might be in this guide later when it is finished.

    Template hierarchy in detail

    The amending templates guide might be a comprehensive guide all about customizing the templates/creating custom templates/customizing how theme compatibility works, and not necessarily about just copying the templates in your theme and knowing that you can customize it.

    #166833
    deanljbirch
    Participant

    Hey Robkk,

    Thanks for getting back to me.

    Link : https://codex.bbpress.org/themes/amending-bbpress-templates/ (Last paragraph 2nd word)

    Deano 🙂

    #166830
    Robkk
    Moderator

    It is weird that you got this new issue. I just tested the snippet again on my WAMP server to check with the latest version of WordPress, switched to German again, and also see if it conflicts with the last code snippet I gave you, but I do not see an issue on my side.

    #166829
    dayan89
    Participant

    Hi,

    I have two menu areas on my website: main and top. I would like to add user profile link to top menu only.

    I found this example, which was were useful: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#8-add-edit-profile-to-a-wordpress-menu But it adds link to both menus, top and main. I would like to add user profile link only to top menu, without adding it to main menu.

    Can you help me please?

    #166828
    project_subdomain
    Participant

    just had the problem that on all not bbpress-related pages the title was ” ‘s “.
    When commenting out the part for “User is viewing someone else’s profile” it’s working correctly on all pages, also when viewing another profile:

    else {
    			$new_title['text'] = sprintf( esc_attr_x( "%s's", 'User viewing another users profile', 'bbpress' ), get_userdata( bbp_get_user_id() )->display_name );
           }

    fyi new occurred, just had a wordpress update recently

    #166827
    project_subdomain
    Participant

    UPDATE: sorry, thought code is causing the browser’s title as ” ‘s” on all non-bbpress-related pages. need to find the reason which does not seem to be in relation to this topic.

    #166825
    wpman
    Participant

    I have a taxonomy:location
    I try to register views for all terms.but it doesn’t work.


    function taxonomy_custom_views() {
    $args = array('orderby'=>'asc','hide_empty'=>true);
    $terms = get_terms(array('location'), $args);
    foreach($terms as $term){
    $location_term=$term->slug ;
    $location_name=$term->name ;
    bbp_register_view( $location_term , __( $location_name ),array('tax_query' => array(array('taxonomy' => 'location','field' => 'slug','terms' => $location_term,),),), false );
    }
    }
    add_action( 'bbp_register_views', 'taxonomy_custom_views' );

    #166820

    In reply to: Groups and Forums

    Robkk
    Moderator

    [bbp-topic-form forum_id=$forum_id] – Display the ‘New Topic Form’ for a specific forum ID.

    Shortcodes

    #166819
    project_subdomain
    Participant

    to prevent showing all users’ replies in ‘my replies’ this code works instead, which robkk wrote:

    function custom_bbp_has_replies( $args ) { 
        if ( bbp_is_single_topic() && !bbp_is_single_user() ) { 
            $args['orderby'] .= 'post_modified';
            $args['order'] .= 'DESC';
        } 
        return $args; 
    } 
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
    #166818
    lfeddern
    Participant

    Hi,

    I have a catagory with several different forums in it. I would like to display the most recent topics from the category. Am I right in thinking there is no shortcode that allows this?

    Could I achieve this by just getting them to display some how by forum id? If I have to query the latest topics from certain forums which function would I have to use? I have looked at the docs but the functions don’t seem to be documented.

    Thanks for any help;

    #166817
    project_subdomain
    Participant

    great, it’s working! thank you so much – really saved my day (night already)! just had to change some brackets. so this is working:

    function custom_bbp_has_replies( $args ) { 
        if ( bbp_is_single_topic() && !bbp_is_single_user() ) { 
            $args['orderby'] .= 'post_modified';
            $args['order'] .= 'DESC';
        } 
        return $args; 
    } 
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
    #166816

    In reply to: Groups and Forums

    chigoziekyrian
    Participant

    Thanks for your reply, please where can i get the forum specific topic form short code, do you have or know it? because i haven’t seen it before.. thanks

    #166811

    In reply to: Comments

    Robkk
    Moderator

    Moved your reply to here since it is related to the topic you created earlier.

    You cannot move additional replies to a subforum by default or with a plugin I know. You may need to consider hiring a developer for to create this for you.

    Since I think you basically said the topic gets hidden in all the replies. You can use this function to always display the topic no matter what page you are on like how these forums have by default.

    function custom_bbp_show_lead_topic( $show_lead ) {
      $show_lead[] = 'true';
      return $show_lead;
    }
     
    add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );
    #166807
    Robkk
    Moderator

    Well there are these if you do not have show topic lead enabled.

    add_action( 'bbp_theme_before_reply_content', 'function_name' );		
    add_action( 'bbp_theme_after_reply_content', 'function_name' );	

    You may need to use a conditional to only display your value on the first reply/topic if they have the same ID.

    if ( bbp_get_reply_id() == bbp_get_topic_id() ) {

    #166805
    Robkk
    Moderator

    Does this PHP function help any?? Place this code in your child theme or funcitonality plugin.

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

    @Robkk
    thanks again for your effort!
    Just had several tries after looking into the conditional tags also, it’s always saying that the user doesn’t have any replies to topics created yet.
    Also made sure now the code of the related topic-link is causing displaying all user’s replies.

    #166798
    Robkk
    Moderator

    I think this is somewhat related to your other topic here.

    Recently edited replies to the top

    I guess you have to make sure the reply sorting is only working on the single topics and not the user profile pages.

    You can try something like this to see if it works. You may not even need the second conditional bbp_is_single_user() but I was making sure.

    function custom_bbp_has_replies( $args ) { 
        if ( bbp_is_single_topic{} && !bbp_is_single_user() ) { 
            $args['orderby'] .= 'post_modified';
            $args['order'] .= 'DESC';
        } 
        return $args; 
    } 
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );' );

    Since I am not 100% sure that I have the right conditionals since I haven’t tested this you can double check here.

    bbPress Conditional Tags

    #166795
    Robkk
    Moderator

    It is missing on the frontend of your site on the topic and reply forms right??

    Did you make sure you have the Post Formatting enabled in Settings > Forums?

    You can also see if it is a plugin issue by trying some troubleshooting. You can also see if you have some code snippet in your theme by switching to a default theme temporarily to see if it fixes the issue.

    Troubleshooting

    #166791
    davellan
    Participant

    Stackoverflow came to the rescue, and I have this question to thank for it.

    If you read all the comments, it gets to the solution, which in my case was this code.

    function i4w_authenticated_remote_login_action($user, $contact) {
      global $SESSION;
      IF ($arrTAGS = explode(',', $SESSION['i4wuser']['Groups'])) :
        IF (in_array(38181, $arrTAGS) || in_array(38185, $arrTAGS) || in_array(38193, $arrTAGS)) :
          $user_id = get_current_user_id();      
          $new_role_forum_role="bbp_participant";
          bbp_set_user_role( $user_id, $new_role_forum_role );
          $wp_user_capabilities_arr = array("subscriber" => true, "bbp_participant" => true, "bbp_spectator" => false);
          update_user_meta($user_id, "wp_capabilities", $wp_user_capabilities_arr);
        ELSEIF (in_array(38177, $arrTAGS) || in_array(38195, $arrTAGS) || in_array(38183, $arrTAGS) || in_array(38187, $arrTAGS) || in_array(38189, $arrTAGS)) :
          $user_id = get_current_user_id();      
          $new_role_forum_role=”bbp_spectator”;
          bbp_set_user_role( $user_id, $new_role_forum_role );
          $wp_user_capabilities_arr = array("subscriber" => true, "bbp_spectator" => false);
          update_user_meta($user_id, "wp_capabilities", $wp_user_capabilities_arr);
        ENDIF;
      ENDIF;
    }
    add_filter('i4w_authenticated_remote_login', 'i4w_authenticated_remote_login_action', 1, 2);

    I am a bit confused as to why I needed to use the update_user_meta to remove the additional capabilities (or why I would have had additional capabilities generated from the bbp_set_user_role function). If someone could answer that it would be greatly appreciated, as I am sure this code is not 100% efficient.

    #166755
    project_subdomain
    Participant

    Solved it, maybe it’s helping others as well.
    It’s been caused by a custom code in my functions that did sort the replies and with which I had no problems so far. As bbpress now has this reply order feature integrated, it has not only become redundant but conflicting. First appearing when I star to use bbpress’ integrated reply order feature, resulting in showing all replies of a users as “my replies” instead of the user’s only.

    So without looking into the code I’m assuming it’s detected by the user’s ID as usual.

    #166740
    Robkk
    Moderator

    It could be a caching plugin or just cache in general. You may need to clear the cache on your site to see if everything works out well. Just deactivating a cache plugin will not clear whatever cache is still saved on your site.

    Troubleshooting

    Robkk
    Moderator

    Try to see if it could be a plugin issue, like a spam plugin scanning a reply before it is posted or something.

    Troubleshooting

    It could also be the bbPress subscriptions hogging everything down. This plugin will hopefully help things out.

    https://wordpress.org/plugins/asyncronous-bbpress-subscriptions/

Viewing 25 results - 7,851 through 7,875 (of 32,522 total)
Skip to toolbar