• shreesays

    (@shreesays)


    Hi,

    When I am trying to add below code in header.php (as provided in https://docs.designsandcode.com/search-filter/ ) it is throwing syntax error.

    <?php echo do_shortcode(‘[searchandfilter fields=”search,category,post_tag”]’); ?>

    Can you please help to setup “search and filter” plugin ?
    Also there are many plugins which asks to insert shortcodes. Where do we need to add.

    Thanks,
    Shreedhar

Viewing 1 replies (of 1 total)
  • Madhusudan Pokharel

    (@madhusudan977)

    Hello Shreedhar,
    You are near to implementing the shordcode in the theme.
    Put the code below inside inc/hook/header.php line at say, line no. 31.
    You can add shortcode in header.php anywhere, taking care of proper syntax of php.

    <?php echo do_shortcode('[searchandfilter fields="search,category,post_tag"]'); ?>

    To display the shortcode in widgets area you should add the below code using text widget. As for pages and posts area you should put the shortcode inside content textarea.

    [searchandfilter fields="search,category,post_tag"]

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘How to insert shortcode into the site?’ is closed to new replies.