Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3145344
Remove Portfolio from search
Closed

Comments

  •  2
    Fjura started the conversation

    Hello,


    may I ask, is it possible to remove Portfolio pages from the search result page? Thank you

  •  2,487
    PenciDesign replied

    Hi,

    Please add the following code to the Soledad child theme "functions.php" file or via the Code Snippet plugin here:

    add_action( 'init', 'fjura_update_my_custom_type', 99 );
    function fjura_update_my_custom_type() {
        global $wp_post_types;     if ( post_type_exists( 'portfolio' ) ) {         // exclude from search results
            $wp_post_types['portfolio']->exclude_from_search = true;
        }
    }

    Regards,
    PenciDesign.



  •  2
    Fjura replied

    Hello,


    thank you, I added it, but it seems nothing happens, you can still see the portfolio in search result: 

    https://www.lenivakucharka.sk/?s=steak

  •  2,487
    PenciDesign replied

    Hi,

    For this case, please send me your WordPress admin account in a PRIVATE reply.
    I'll log in and try to help you.

    Regards,
    PenciDesign.



  •  2
    Fjura replied

    Hello,


    thank you, but is there no other way of myself fixing it with your help? 


    thank you

  •  2,487
    PenciDesign replied

    Hi,

    You can install the Ivory Search plugin and then exclude any post type you want by following the document here: https://wordpress.org/plugins/add-search-to-menu/

    Regards,
    PenciDesign.