Inserting shortcode into search.php

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Inserting shortcode into search.php

This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11564
    thorntonp72
    thorntonp72
    Participant

    Hi,

    Since I cannot modify the menu bear, my theme has a search icon, for which the results are very basic, but I am wokring on that. What I am trying to do is somehow, include the ajax pro search into the results page. I thought I would try the line below, but I do not get any results. Can you suggest a better way as the search results page has no template to modify.

    <div class=’page-heading-container clearfix’>
    <section class=”search_form_field”>
    <?php
    do_shortcode( ‘wpdreams_ajaxsearchpro id=4’ );
    // echo “<h4>”.__(‘New Search’,’avia_framework’).”</h4>”;
    echo “<p>”.__(‘Try Another Search’,’avia_framework’).”</p>”;

    get_search_form();
    echo “<span class=’author-extra-border’></span>”;
    ?>
    </section>
    </div>

    Thank you

    #11565
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The do_shortcode() function call must be echoed, so try changing this line:

    do_shortcode( 'wpdreams_ajaxsearchpro id=4' );

    to this:

    echo do_shortcode( '[wpdreams_ajaxsearchpro id=4]' );

    That should give you an output.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11566
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Also, I just noticed the shortcode brackets missing:

    echo do_shortcode( '[wpdreams_ajaxsearchpro id=4]' );
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11567
    thorntonp72
    thorntonp72
    Participant

    Wow that was damn quick and worked like a charm. Thank you very much for your help once again!!!

    #11568
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.