Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,701 through 2,725 (of 32,492 total)
  • Author
    Search Results
  • #211690
    Robin W
    Moderator

    great – it may well be buddypress or WordPress.

    If you give me a link, I’ll register and might be able to tell from the code sent to the browser

    #211677
    ollybach
    Participant

    Got a notification in my WP plugins admin page there’s an update of bbBress (Version: 2.6.5
    – 5 days ago)

    Following the changelog link, gets me here https://codex.bbpress.org/releases/

    there is no mention of 2.6.5 (even 2.6.4 is still TBA)…..

    so without knowing even the most basic things as to what might have changed I cannot in good faith update the plugin

    PS: hmm, seems i need to click on “blog” next to the 2.6.4 “TBA” release …..
    perhaps someone should update the https://codex.bbpress.org/releases/ page at some point

    #211671
    Robin W
    Moderator

    hmmm… not sure what to suggest -you must have code that is stopping that role.

    what other plugins are you running?

    Robin W
    Moderator

    ok, I’m not seeing this issue – can you as a test deactivate bbpress do shortcodes and then retest

    JohnRDOrazio
    Participant

    Just “bbPress Do Short Codes”.

    #211638
    Robin W
    Moderator

    thanks for that, and yes I’ll look at the code. I think it does nothing unless you start to fill it in, but an activation tick box might be a better solution.

    Thanks for letting me know and for posting your solution.

    #211591
    Robin W
    Moderator

    in both your cases (main search and empty search) then yes you will have a problem.

    main search can be excluded by looping round the search results and excluding the forum if the search results are from more than one forum.

    Global wp_query is available, and lists the query that was executed, so in there you would find the

    ‘key’ => ‘_bbp_forum_id’,
    ‘value’ => $forum_id,
    ‘compare’ => ‘=’, ,

    part of the query, so you could use that with some nifty code to extract the forum number, but I’ll leave you to work out how to do that !!

    #211590
    Pete
    Participant

    Thanks Robin. That’s given me something to work with.

    As it stands, this will include the current forum in the breadcrumb if the search is executed from a specific forum and the result set is not empty. That is certainly one of the cases addressed.

    But if the search is executed from the main index page, and the result set is not empty, instead of the breadcrumb trail including just Forums > Search > etc., it will include the name of the the first forum that produced a search hit (and obviously not all, where there may be several hits in different forums), which is not really the intent.

    If the search set is empty, however, the name of the forum from which the search was conducted is still missing and I’m not sure I can work out how to get around that, because your code is using one of the search hits to work out what forum to add to the breadcrumb. If the search set is empty, how then can I work out where I’ve come from? I think I’m going to have to know this to even fix the first problem above.

    Is there a concept of something like a global variable here? Can we set the $forum_id variable any time we navigate to a particular forum and just call on that from where ever we are if needed?

    I think it will be the case of the empty search where this will come in most handy, because the reader can quickly flick back to the forum in question and search again, rather than having to go back to the main index page and navigate back to the forum they were working with if they, for example, have just mistyped a search string.

    Thanks again. I had no idea where to even begin…

    #211588
    Robin W
    Moderator

    that was an interesting challenge, as the forum ID is not known when the breadcrumbs start to show, so I had to look up the forum_id from the first result.

    but this should work, just add it to your functions file

    add_filter ('bbp_breadcrumbs' , 'rew_breadcrumb_search' ) ;
    
    function rew_breadcrumb_search ($crumbs) {
    	//create a new array
    	$new_crumbs = array() ;
    	//find the forum from the first item in results
    	if ( bbp_has_search_results()) {
    		while ( bbp_search_results() ) : bbp_the_search_result(); 
    		$type = get_post_type() ;
    		if ($type == 'topic' ) $forum_id = bbp_get_topic_forum_id() ;
    		if ($type == 'reply' ) $forum_id = bbp_get_reply_forum_id() ;
    		if (!empty ($forum_id)) break ;
    		endwhile ;
    	}
    	//cycle through the crumbs until we find search
    	foreach ($crumbs as $crumb=>$data) {
    		if (strpos($data, 'search') !== false) {
    			//If the forum ID exits, add the breadcrumb
    			if( $forum_id && is_numeric( $forum_id ) ){
    				$new_crumbs[] = '<a href="' . esc_url( bbp_get_forum_permalink( $forum_id ) ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title($forum_id ) . '</a>';
    			}
    		}
    		$new_crumbs[] = $data ;
    	}
    return $new_crumbs ;
    }
    #211587
    slimshadys
    Participant

    Nevermind, managed to get it working with this workaround:

    	$author_id = get_post_field( 'post_author', $topic_id );
    

    Now I have the proper $author_id! 🙂

    #211586
    slimshadys
    Participant

    Hello all.
    I’ve been editing the bbPress 2.6.5 plugin a bit, in order to fit my use.

    As of now, I just wanna track down the topic_id and the author_id.
    That’s pretty simple, given the set of functions available for the community.

    So I managed to write this little code here:

    	global $author_id;
    	global $id_of_topic;
    
    	$id_of_topic = bbp_get_topic_id();
        	$author_id = bbp_get_topic_author_id($id_of_topic);
    

    The ID of the Topic is successfully retrieved, let’s say it’s “18446744073709551615”,
    but once I pass that variable to bbp_get_topic_author_id(), the output of $author_id is 0.

    Now that’s pretty weird considering that if I pass the number 18446744073709551615 directly into that function, everything goes fine, I retrieve the author_id successfully.

    One thing I noticed tho, is that printing out $id_of_topic, once with %d and once with %u (just after I call bbp_get_topic_id() ), I get two different values.

    – %d = 0
    – %u = 18446744073709551615

    Pretty weird.. How can I somehow pass the %u to bbp_get_topic_author_id()?

    Thanks in advance! 🙂

    #211578
    desmond234
    Participant

    Theme – Aardvark

    Hey guys, I’m having an issue with how my theme is interacting with the bbpress subforum list. I added the bbpress style pack plugin because of a issue I was having with the search bar, but it resulted in all the subfourms piling up on one another. The issue arises because the subforums have a box background (which I like), but the background overlaps with the other subforums. You can see the issue I’m having here.

    http://www.podfolk.com/forums/

    Does anyone know any code I can put into the style or functions file to resolve the issue?

    #211573
    Robin W
    Moderator

    try adding this to your custom css

    div.bbp-forum-header, div.bbp-reply-header, div.bbp-topic-header, li.bbp-body div.hentry {
    	padding: 0px !important;
    }
    
    .oct-main-content {
    	padding: 0px !important;
    	
    }
    #211567
    Pete
    Participant

    I have a problem with the way breadcrumbs are being displayed on my search results screen.

    First of all, I have the following (amongst other things) in my functions.php file:

    
    /**
    Just a simple breadcrumb trail, but, importantly, don't double up when we're at the root
    **/
    function mycustom_breadcrumb_options() {
    	// Home - default = true
    	$args['include_home']    = false;
    	// Don't need breadcrumbs if we're at the root
    	if ( apply_filters( 'bbp_no_breadcrumb', is_front_page() ) ) {
    	// Forum root - default = true
    		$args['include_root']    = false;
    	// Current - default = true
    		$args['include_current'] = false;
    	}
    	return $args;
    }
    add_filter('bbp_before_get_breadcrumb_parse_args', 'mycustom_breadcrumb_options' );
    
    /**
    Search only the specified forum
    **/
    function my_bbp_filter_search_results( $r ){ 
        //Get the submitted forum ID
        $forum_id = sanitize_title_for_query( $_GET['bbp_search_forum_id'] );
        //If the forum ID exits, filter the query
        if( $forum_id && is_numeric( $forum_id ) ){
            $r['meta_query'] = array(
                array(
                    'key' => '_bbp_forum_id',
                    'value' => $forum_id,
                    'compare' => '=',
                )
            );  
        }
        return $r;
    }
    add_filter( 'bbp_after_has_search_results_parse_args' , 'my_bbp_filter_search_results' );
    

    I have a search box on the forum home page and on the index page for each individual forum. For general navigation around my forum the breadcrumbs are presented as one might expect and search results are confined to those relevant to the current forum (or all forums from the home page).

    The breadcrumbs on the Forum ‘home page’ show simply as Forums and on individual forum index pages as Forums > ForumName, where ‘ForumName’ is the name of the current forum, etc. A search request from the Forum home page returns results as expected, with the breadcrumbs displayed as Forums > Search > Search Results for 'search string'. However, while a search from one of the individual forum index pages returns the refined search results as expected, the breadcrumbs are always displayed as Forums > Search > Search Results for 'search string', they don’t include the name of the forum that has been searched (i.e. Forums > ForumName > Search > Search Results for 'search string'.

    I think I can see that the search is actually being applied to all forums, then refined by the relevant function in the functions.php file, so I think I can see why I might have to do a little extra work to get the relevant forum name displayed in the breadcrumb, but can anyone suggest how I might do this? It would seem that I should be able to add a little more code to my mycustom_breadcrumb_options() function, but what exactly…?

    Thanks for any assistance anyone can offer.
    (WordPress 5.4.1, bbPress 2.6.5, website: digitalconcepts.net.au/forum – Please note, this part of the website is ‘hidden’ from the home page, you need to navigate there via the above direct URL)

    #211535

    In reply to: bbPress Roadmap

    Dion Hulse
    Keymaster

    Like WordPress, bbPress uses a semi-decimal-based versioning system, where bbPress 2.4, 2.5, and 2.6 are considered major versions.

    bbPress 2.6 was a major update with just under 6 years of development:

    This version of bbPress has been in development for just a bit under 6 years (yikes!) over which 420 tickets were resolved via 1737 individual code commits.

    The Full list of releases is available on the bbPress codex, although it doesn’t have the full details for the latest two minor 2.6.x releases.

    #211523
    Robin W
    Moderator

    you could add this to your custom css

    .bbp-login-form {
    	width: 60% !important;
    }
    Robin W
    Moderator

    just remove the code

    and refresh your browser

    amirzwp
    Participant

    I think your code did something really bad, it redirects my forums now to other pages… what can I do?

    For example: https://www.paastoa.com/forum/intervallfasten/

    Robin W
    Moderator

    thanks, ok lets try this

    add_filter( 'wpseo_title', 'rew_meta_title' );
    function rew_meta_title( $title ) {
    global $post ;
           if ($post->post_type == 'reply' ) {
    	 $title = 'this is a reply' ;
        }
     return $title;
    }
    amirzwp
    Participant

    sure, yoast SEO (Also Premium version) is enabled.

    I tried both of the codes you sent me, both doesn’t have an effect on the Meta Title.

    The snippet with the following code is still activated on the website:

    add_filter( 'wpseo_metatitle', 'rew_meta_title' );
    function rew_meta_title( $title ) {
    global $post ;
           if ($post->post_type == 'reply' ) {
    	 $title = 'this is a reply' ;
        }
     return $title;
    }

    So you can check, if there happend something. I deleted the other snippet because it also didn’t had an effect on the website. But when it has an effect, it’s not so good because the website is live.

    Thanks for your time.

    Robin W
    Moderator

    thanks – just to ask the obvious, you are running the yoast plugin ?? 🙂

    then as a test can you try a correction to my previous code

    add_filter( 'wpseo_metatitle', 'rew_meta_title' );
    function rew_meta_title( $title ) {
    global $post ;
           if ($post->post_type == 'reply' ) {
    	 $title = 'this is a reply' ;
        }
     return $title;
    }

    if that fails, can you try (as a test only)

    add_filter( 'wpseo_metatitle', 'rew_meta_title' );
    function rew_meta_title( $title ) {
     $title = 'this is a reply' ;
       return $title;
    }

    This should put that phase at the top of every pages, and will at least show that the filter is working.

    amirzwp
    Participant

    You can check the Title in the Browser-Tab. Currently, it’s showing the following text:

    | Paastoa

    So it’s only the seperator and the website title…

    Also when you open the source code of the page, it shows:

    <title>| Paastoa</title>

    URL: https://www.paastoa.com/antworten/8907/

    Thanks for your help.

    #211501
    Robin W
    Moderator

    Sorry I’m just a bbpress user who helps out here. I don’t have time to research every part of code – the answer is no doubt yes.

    #211494
    zandercent
    Participant

    a bit hacky – but sure. Is there a way to disable just the part that shows all the other links on site? Or use a more standard forum link insertion method (that doesn’t mean adding a bbcode plugin)?

    Robin W
    Moderator

    I don’t have any sites with both yoast and forums on them (my forum sites are profession related sites with private forums so don’t want to advertise!).

    So I don’t know which part of the code is faulty.

    If you are able to test, then start with

    add_filter( 'wpseo_metatitle', 'rew_meta_title' );
    function rew_meta_title( $title ) {
           if ($post->post_type == 'reply' ) {
    	 $title = 'this is a reply' ;
        }
     return $title;
    }

    this should make the title of each reply ‘this is a reply’

    if that works, then we kwow the function is working, but not getting the right answer !

    If it doesn’t work, then I’ll come back with another

Viewing 25 results - 2,701 through 2,725 (of 32,492 total)
Skip to toolbar