Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,076 through 5,100 (of 32,518 total)
  • Author
    Search Results
  • #185618
    Robin W
    Moderator

    ok, a new page in a default theme has this

    <div class="entry-content">
    <div id="bbpress-forums">
    

    your page has this

    <div class="entry-content">
    <div style="clear: both"></div>
    <div class="the_champ_sharing_container the_champ_horizontal_sharing" super-socializer-data-href="https://www.lifeleap.org/community/">
    <div class="the_champ_sharing_title" style="font-weight:bold">Share:</div>
    <ul class="the_champ_sharing_ul">
    <li class="theChampSharingRound">
    <li class="theChampSharingRound">
    <li class="theChampSharingRound">
    <li class="theChampSharingRound">
    <li class="theChampSharingRound">
    </ul>
    <div style="clear:both"></div>
    </div>
    <div style="clear: both"></div>
    <p>
    <br>
    </p>
    <div id="bbpress-forums">

    Don’t think it’s bbpress

    #185599
    andrew55
    Participant

    This is exactly what we need. But when I use this function…

    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Subscriber' ) {
    	$translated_text = 'Member';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    …it doesn’t change “Subscriber” to “Member” in profile area or anywhere else.

    Any suggestions on what I can do to get this working?

    Thanks for any help.

    #185591
    daileycon
    Participant

    I DID IT!!!! Now this adds an edit profile link in my top bar menu only if someone is logged in! Whooo hooo

    add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 );
    function your_custom_menu_item ($menu , $args ) {
        if (is_user_logged_in() && $args->theme_location == 'topbar_navigation') {
            $current_user = wp_get_current_user();
            $user=$current_user->user_nicename ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
        }
        return $menu;
    }
    #185590
    daileycon
    Participant

    Ok I found my menu slugs in my functions file.

    // Add Custom Primary Navigation
    function minti_register_custom_menu() {
    	register_nav_menu('main_navigation', 'Main Navigation');
    	register_nav_menu('footer_navigation', 'Footer Navigation');
    	register_nav_menu('topbar_navigation', 'Topbar Navigation');
    }

    but I still get that error when changing primary to topbar_navigation

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu , $args) {
        if (is_user_logged_in() && $args->theme_location == 'topbar_navigation')
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_nicename ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
    }
    #185588
    daileycon
    Participant

    That code gives me this error in all 3 menus. I just want Edit Profile in the top menu.

    Warning: Missing argument 2 for my_nav_menu_profile_link(), called in /home/wp_5fnr6w/my site/wp-includes/class-wp-hook.php on line 300 and defined in /home/wp_5fnr6w/my site/wp-content/themes/unicon/functions.php on line 749

    If I remove “&& $args->theme_location == ‘primary'” and ” , $args”

    The error goes away but I have Edit Profile in all three menus.

    #185585
    Robin W
    Moderator

    ok, this is untested for functionality, but doesn’t error

    add_filter( 'bbp_get_topic_subscribers', 'rew_filter_subscrbers' );
    add_filter( 'bbp_get_forum_subscribers', 'rew_filter_subscrbers' );
    
    function rew_filter_subscribers ($users) {
    	$role = 'my_custom_role' ;
    	$filtered_ids = array();
    	foreach ( (array) $users as $user_id ) {
    		$user_info = get_userdata($user_id);
    		$user_roles = $user_info->roles ;
    		if (!in_array ($role, $user_roles)) {
    			array_push($filtered_IDs, $user_id);
    		}
    	
    	}
    return $filtered_ids ;
    }

    Do you know how to put this in to your child theme’s functions file?

    If so you will need to change my_custom_role in this line

    $role = 'my_custom_role' ;

    to the role name that you are using

    If you don’t know how to use functions file, then come back

    #185575
    Robin W
    Moderator

    probably this should work

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    
    function my_nav_menu_profile_link($menu , $args) {
        if (is_user_logged_in() && $args->theme_location == 'primary') {
            $current_user = wp_get_current_user();
            $user=$current_user->user_nicename ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
        }
    	return $menu;
      
    }
    #185572
    daileycon
    Participant

    I’m using the following code to add an edit profile link in the menu. But it adds it to All menus, I have a top, main and footer menu. I just want it added to the top menu. Any help?

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu , $args) {
        if (is_user_logged_in() && $args->theme_location == 'primary')
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_nicename ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
      
    }
    #185559
    Robin W
    Moderator

    not exactly sure what you are after, but try this code and play with it

    put this in your functions file – you don’t need to alter any templates

    add_action ('bbp_theme_after_reply_author_details', 'rew_display');
    add_action ('bbp_theme_after_topic_author_details', 'rew_display'); 
    
    //main function to display
    function rew_display () {
    	global $reply_id ;
    	$author_id=bbp_get_reply_author_id( $reply_id ) ;
    	$user = Am_Lite::getInstance()->getUser(); 
    	$some_match = Am_Lite::getInstance()->haveSubscriptions(364))
    	if ($author == $user && $some_match == "hello" ) {
    		echo '<div class = "rew_display">' ;
    			echo '<ul>' ;	
    				echo '<li>' ;
    					echo "I've donated" ;
    				echo '</li>' ;
    			echo '</ul>' ;
    		echo '</div>' ;
    	}
    }

    Come back if I can help clarify

    #185536
    andrew55
    Participant

    OK, forget my additional code. Can someone please let me know what snippet (just for bbBress) to show something only in the profile area of the reply author, only if it applies to them.

    In other words: “show if it applies to this specific reply author.”

    I’ve edited loop-single-reply.php with great results for similar features.

    Thanks for any suggestions.

    #185503
    Alex Stine
    Participant

    Looking back on it now, I never did have the development time to make this work before I discontinued CloudSearch, but this looks to be the best code if anyone’s brave enough to try it in the future. 🙂

    function exclude_topics_in_private_forum() {
    $forum_id = bbp_get_forum_id();
    $query = bbp_get_all_child_ids($forum_id, 'post');
    foreach($query as $key => $q) {
    if(is_private_forum($forum_id) ) {
    update_post_meta($key, 'exclude', 1);
    } elseif(!is_private_forum($forum_id) ) {
    delete_post_meta($q, 'exclude');
    }
    }
    }
    add_action('bbp_new_forum', 'exclude_topics_in_private_forum' );
    add_action('bbp_edit_forum', 'exclude_topics_in_private_forum' );

    Thanks for the help.

    #185502
    Alex Stine
    Participant

    Hello,

    I started to work on the code and then got my bill. That’s when I instantly stopped using CloudSearch. It’s a good starting place though. If I ever revisit CloudSearch in the future, I’m coming back for the code.

    Thanks for the help.

    #185420
    Robin W
    Moderator

    have you been to

    Custom Capabilities

    #185419
    Robin W
    Moderator

    bbpress hates local server !

    try adding this to your function file

    add_filter( 'bbp_verify_nonce_request_url', 'my_bbp_verify_nonce_request_url', 999, 1 );
    function my_bbp_verify_nonce_request_url( $requested_url )
    {
        return 'http://localhost:8888' . $_SERVER['REQUEST_URI'];
    }
    #185412
    Brandon Allen
    Participant

    @peterwsterling,

    The HTML tags are being converted to HTML entities in bbp_topic_pagination_count(), because of output esacping (esc_html() in this case). If you want to wrap the output from bbp_get_topic_pagination_count() in a <span>, you’ll need to replace all usages of bbp_topic_pagination_count() with your own custom output function, or echo bbp_get_topic_pagination_count(). The latter is not recommended. A custom output function might look like below:

    
    function my_topic_pagination_count() {
        echo '<span>' . esc_html( bbp_get_topic_pagination_count() ). '</span>';
    }
    
    #185409
    Stephen Edgar
    Keymaster

    @peterwsterling Can you add a copy of the exact code you’re using please?

    #185408
    peterwsterling
    Participant

    There seems to be some extra filtering going on in the bbp_get_topic_pagination_count filter that I use to insert some extra detail about who (which logged in users) has seen a post. That’s fine of course. The problem for me is that I insert a <span> (with a class) to enable styling of my extra content and this new filtering is coding the HTML, e.g. < becomes &lt ; etc. Can this be addressed please? Or can you direct me as to which filter to switch off please?

    #185370
    tonezzz
    Participant

    Oops! I think that’s the original WP code itself. Anyway, I found another code to fix in bbPress. Pls let me know if I should post it.

    tonezzz
    Participant

    Hello everybody.

    If this is off topic, pls help pointing me to the correct place.

    This is the first time I’m working with bbPress, I’m trying to import from vBulletin now.

    
    vBulletin = 3.8.6
    bbPress = bbPress 2.5.12
    WP = 4.7.5
    

    I’ve been struggling for a few days already (I’ve also tried the 2.6-rc-3 without any luck). Just today, I found an advice to enable WP_DEBUG and WP_DEBUG_LOG so I did so and saw some error messages so I decided to look into the code and try to fix it myself.

    Here’s the first one I found:

    
    PHP Notice:  Undefined index: user_pass in ...\wp\wp-includes\user.php on line 1425
    

    Here’s the code at line 1425:

    
    $user_pass = wp_hash_password( $userdata['user_pass'] );
    

    Should be changed to:

    $user_pass = empty($userdata['user_pass'])?wp_hash_password(''):wp_hash_password( $userdata['user_pass'] );

    There’re more errors I’m trying to fix right now. Pls let me know if it’s helpful and I should post them too.

    Cheers,
    Tony.

    #185355
    Droidism
    Participant

    WordPress version 4.8
    bbPress version 2.5.12
    Site URI: Localhost (I can create a temp vpn tunnel to the site if needed.)

    Hi,

    I am confused about the following setup and theme page template/bbPress weirdness.

    I have installed bbPress and set the forum root to “support” and saved changes.
    Then I created a page with the exact same name “support“. The slug matches the page name and reads: www.mysite/support/
    In this page I have added the bbpress short code [bbp-forum-index]

    With the current theme I have the option to choose a page template with or without a sidebar. When I set the page template to “sidebar“, the sidebar does NOT display.

    When I change the “forum root” from “support” to “forums” and leave the page name and template choice as is, the sidebar does display.

    The same applies when I do not change the Forum root and leave it as “support“, but I remove the bbPress shortcode [bbp-forum-index]. The page “support” does show the sidebar.

    I am wondering if I am doing something wrong with either setting the Forum root slug and the page name to the exact same; “support“.

    Maybe this is not possible and leads to url/permalink confusion in WP/bbPress and it instead uses the “standard” page template (which doesn’t utilises any sidebars in the current theme I am using.)

    In the end what I would like to see is the following (if possible at all.);

    When you visit the site’s support page the url/slug read: www.mysite.com/support/
    The page title matches the slug: “Support” and it uses the sidebar page template.

    In this page the support questions are shown by freshness and the breadcrumb actually displays “home >> support“, not “home >> forums“.

    Thanks in advance for any help in explaining the Forum root and page name scheme/setup.

    #185330
    ScottyChoc
    Participant

    WordPress version 4.8
    Genesis Theme version 2.5.2
    bbPress version: 2.5.12
    Site URL: http://staging.c-rad.org/

    My site has a members section for which all of the pages in it have a template applied to it with this simple logic:

    	if ( ! is_user_logged_in()) {
    		wp_login_form();
    		return;
    	} else {
    		// add the members only sidebar and show the content
    	}
    

    Is it possible to install bbPress such that I can apply this template logic to all forum pages?

    I also want all forum pages to exist under a parent page. e.g. c-rad.org/members/forums.

    I can place my forum there (c-rad.org/members/my-forum) using a shortcode, but then all other forum pages go to their default locations (c-rad.org/topic/my-topic).

    I tried changing the Forum Root to ‘members’, but then when I visit that page, the page template with my logic is removed.

    #185311
    ncrocketry
    Participant

    Also for reference, here is a page with the shortcode as described in the documentation to display a single forums topics. eg. [bbp-single-forum id=32].

    General

    #185310
    ncrocketry
    Participant

    I’ve tried to create pages with shortcodes, but the result is the same.

    #185306
    enacta2
    Participant

    @robin-w I applied your CSS code for root and forum and it works well. But the top part of the box is missing. I tried to ‘fix’ the button so it’s whole, but I’m unable. I tried many different CSS lines, including the following, and none worked.

    Can you please tell me how to make the button so it’s complete?

    I don’t have a live site with bbPress. It’s only on my localhost mirror for now, until I get it all setup the way I want.

    /* Set breadcrumb from topic to its forum with blue button */
    .bbp-breadcrumb-forum {
      background: #6D84B4;
      background-image: -webkit-linear-gradient(top, #6D84B4, #3B5998);
      background-image: -moz-linear-gradient(top, #6D84B4, #3B5998);
      background-image: -ms-linear-gradient(top, #6D84B4, #3B5998);
      background-image: -o-linear-gradient(top, #6D84B4, #3B5998);
      background-image: linear-gradient(to bottom, #6D84B4, #3B5998);
      -webkit-border-radius: 28;
      -moz-border-radius: 28;
      border-radius: 28px;
      -webkit-box-shadow: 0px 2px 0px #000000;
      -moz-box-shadow: 0px 2px 0px #000000;
      box-shadow: 0px 2px 0px #000000;
      font-family: Arial;
      color: #000000;
      font-size: 11px;
      padding: 7px 15px 7px 15px;
      text-decoration: none;
    }
    
    .bbp-breadcrumb-forum:hover {
      background: #AFBDE1;
      background-image: -webkit-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: -moz-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: -ms-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: -o-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: linear-gradient(to bottom, #AFBDE1, #6D84B4);
      text-decoration: none;
    }
    
    /* Set breadcrumb prepended text for button from topic to its forum */
    .bbp-breadcrumb-forum::before {
      content: "Back to the ";
    }
    
    /* Set breadcrumb appended text for button from topic to its forum */
    .bbp-breadcrumb-forum::after {
      content: " forum";
    }
    
    /*-------------------------------------------------------------------------------------------*/
    
    /* Set breadcrumb from forum to its root with blue button */
    .bbp-breadcrumb-root {
      background: #6D84B4;
      background-image: -webkit-linear-gradient(top, #6D84B4, #3B5998);
      background-image: -moz-linear-gradient(top, #6D84B4, #3B5998);
      background-image: -ms-linear-gradient(top, #6D84B4, #3B5998);
      background-image: -o-linear-gradient(top, #6D84B4, #3B5998);
      background-image: linear-gradient(to bottom, #6D84B4, #3B5998);
      -webkit-border-radius: 28;
      -moz-border-radius: 28;
      border-radius: 28px;
      -webkit-box-shadow: 0px 2px 0px #000000;
      -moz-box-shadow: 0px 2px 0px #000000;
      box-shadow: 0px 2px 0px #000000;
      font-family: Arial;
      color: #000000;
      font-size: 11px;
      padding: 7px 15px 7px 15px;
      text-decoration: none;
    }
    
    .bbp-breadcrumb-root:hover {
      background: #AFBDE1;
      background-image: -webkit-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: -moz-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: -ms-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: -o-linear-gradient(top, #AFBDE1, #6D84B4);
      background-image: linear-gradient(to bottom, #AFBDE1, #6D84B4);
      text-decoration: none;
    }
    #185295
    Martin
    Participant

    Hi @chadschulz. I Tried with that code but it didn’t work with [pgn] and the chessboard plugin.

    @yo35
    any Idea?

    Thanks a lot!

Viewing 25 results - 5,076 through 5,100 (of 32,518 total)
Skip to toolbar