Support » Plugin: BuddyPress Global Search » Search results for pages renders shortcodes

  • When I conduct a search using Buddyboss, any of the pages that were built using Visual Composer, and therefore contain quite a few shortcode, render with the shortcodes showing.

    I know the shortcodes in posts are translated to show the content, is there a way to do this for pages as well? You can see what I mean by going here:

    http://staging.ignition90.com/bi2/?s=aluminum

    and clicking the “Blog Posts” tab.

    Also, is there a way to split out blog posts from pages? They aren’t really the same thing.

    –Sean

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author BuddyBoss

    (@buddyboss)

    @seanrnicholson, Shortcodes inside search result is a known issue and we have raised the priority of the task.
    For Post and Page, we have also included in our suggestion list to make them separate in our coming updates.

    Thanks, I noticed there was a recent update to the plugin. Is there any ETA on the following elements:

    1) Search results still display shortcode results
    2) Splitting search results between posts and pages

    Thanks!

    –Sean

    Plugin Author BuddyBoss

    (@buddyboss)

    Hi @seanrnicholson, These should be fixed in next couple of week.

    Can this be fixed in the functions.php file similar to this?

    http://www.relevanssi.com/knowledge-base/divi-page-builder-and-cleaner-excerpts/

    A work around is to edit post-ajax.php and add this

    			<?php  
    			if ( get_post_type( get_the_ID() ) == 'post' ) {
                    $content = wp_strip_all_tags( do_shortcode( get_the_content() ) );
                    $trimmed_content = wp_trim_words( $content, 20, '...' ); 
    			} elseif ( get_post_type( get_the_ID() ) == 'page' ) {
                    $content = wp_strip_all_tags( do_shortcode( get_the_excerpt() ) );
                    $trimmed_content = wp_trim_words( $content, 20, '...' ); 
    			}				
                ?>
    Plugin Author BuddyBoss

    (@buddyboss)

    Hi @exentric,
    we already have been stripping search results.

    Hi BuddyBoss,

    Are you sure you are stripping search results? I just activated version 1.1.7, which seems to be the latest, and I am still getting Visual Composer shortcodes showing up in search results.

    I tried both snippets mentioned above and neither worked. Please confirm that the plugin is taking out the shortcodes and provide some help for those it’s not working for.

    Thanks

    The plugin is not stripping VC tags (maybe this is where the mix up is happening), so as you can see in my code I tell it to show the excerpt instead of the content if it is a page because I only use VC on pages and not posts

    Hi @exentric,

    I tried your code but it didn’t work- I don’t know why. I’m hoping BuddyBoss will post a new reply and get this issue fixed.

    Plugin Author BuddyBoss

    (@buddyboss)

    @catonezillion We have included in our todo list and will try to wrap in our next update.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Search results for pages renders shortcodes’ is closed to new replies.