• Resolved MickWP

    (@mickwp)


    Hi,

    Great plugin that is working well.

    I’m experimenting with showing alternative content in my search results (search.php) but the same shortcode I use in my posts/pages isn’t working for me (it just shows the shortcode text).

    Any help to get this working appreciated.

    Thank you.

    https://ww.wp.xz.cn/plugins/amr-shortcode-any-widget/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter MickWP

    (@mickwp)

    Hi again,

    Lots of reading up and it led me to the fact that it is outside of the ‘loop’.

    Used <?php echo do_shortcode (‘[do_widget id=myid]’); and it worked fine.

    Hope this helps others.

    Plugin Author anmari

    (@anmari)

    I guess that will work – seems so cumbersome though.

    Personally I’d look at skipping this plugin entirely and using
    https://codex.ww.wp.xz.cn/Function_Reference/the_widget passing the arguments that the widget needs directly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using in search.php file.’ is closed to new replies.