Home Forums WoodMart support forum search code

search code

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #593908

    greg-9795
    Participant

    hi

    on our default 404 page, there is a search function, only searching the posts. We want to search the whole site, not only the posts.

    what code we require to search (Whatever you are wanting to search)

    it is currently

    <?php
    woodmart_search_form(
    array(
    ‘post_type’ => apply_filters( ‘woodmart_404_search_post_type’, ‘post’ ),
    )
    );
    ?>

    #593911

    greg-9795
    Participant

    photo of the code below.
    It is in the woodmart theme

    Attachments:
    You must be logged in to view attached files.
    #594152

    Hung Pham
    Keymaster

    Hi greg-9795,

    Thanks for reaching to us.

    First of all, I’m really sorry have taken long time to reply you due to the weekend.

    Please add this code to the functions.php of the child theme:

    add_filter('woodmart_404_search_post_type', 'wd_404_search_post_type' );
    function wd_404_search_post_type( $post_type ) {
    	return 'any';
    }

    This code would make a search to find all post types.

    If you have any questions please feel free to contact us.

    Best Regards,

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)