• Resolved flamey23

    (@flamey23)


    Hello,
    I am following the e-commerce tutorial on how to create a store with woo commerce:https://www.youtube.com/watch?v=zE9BiBebFMI
    I am adding the advanced woo search plugin by ilid.
    This is where it gets a bit complicated so bear with me:)
    I want the search bar to be after my navbar in the header.
    Once the plugin is activated,it says it is to be added to a webpage by adding short code to the header via the customiser within the html element.
    However, I am using the Blocksy theme. I already have a html element in the header already, and cannot add a second html element.
    So I am thinking of adding the search bar with php using wpcode for the code snippets. I installed wpcode snippets to add php code to the header, but do not know the correct way to add php to the header via wpcode, and to position it correctly.
    I have searched everywhere for code, but cannot find it anywhere.
    Any help with how to add this advanced woo search to the header with php via wpcode would be so gratetful. Been stuck on this for ages!

    • This topic was modified 1 year, 1 month ago by flamey23.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Please read this article. Perhaps it will help to solve your problem.

    Regards

    Thread Starter flamey23

    (@flamey23)

    Hello!

    Thank you for reply. Unfortunately the link leads to a blank web page.

    I am wondering if maybe I need to use things called hooks to activate the plug? I cannot find any code to activate things like shortcode. I am new to wp and coding. I am wondering if there is ja simple way to add content to the header using wpcode snippets.

    Thread Starter flamey23

    (@flamey23)

    I have added the following to activate the shortcode and the search bar now appears:

    <?php
    function custom_header_code() {
        ?>
       <?php echo do_shortcode( '[aws_search_form]' ); ?>
    
        <?php
    }
    add_action( 'wp_nav_menu', 'custom_header_code' );
    ?>
    
    
    
    

    However, it is making my navbar disappear. I want to add the search bar after the navigation bar row. Is there a hook after elements such as the navbar? It needs to be in the main row-not the top or bottom header rows. Is there a way of defining which row? Can the search element be accessed via css?

    • This reply was modified 1 year, 1 month ago by flamey23.
    • This reply was modified 1 year, 1 month ago by flamey23.
    • This reply was modified 1 year, 1 month ago by flamey23.
    Plugin Author ILLID

    (@mihail-barinov)

    Please check this article one more time. Now it must be working fine.

    You can use the following code snippet from the article to place the search form after the nav bar:

    add_filter( 'wp_nav_menu', 'my_wp_nav_menu', 10, 2 );
    function my_wp_nav_menu( $nav_menu, $args ) {
        $aws_form = aws_get_search_form( false );
        $nav_menu = $nav_menu . $aws_form;
        return $nav_menu;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Installation’ is closed to new replies.