• First of all I am very sorry for posting such a noob question on these forums but I started WordPress only a day ago and it’s pretty though for now. I was asked to write a plugin that does some searching based on post content and displays the matching posts’ titles in the left sidebar or the main right bar (using the default theme) based on some simple criteria. Now, the searching and filtering I figured out so far but the only way I’m able to display my results is by this piece of code found in a tutorial for plugin writing:
    add_action( 'wp_footer', 'bi_mfp_do_stuff' );
    where off course bi_mfp_do_stuff is a function doing all the work including the echo instructions for printing the results. The only problem with that is that it puts every output text in the footer. Now since the task I was given asks for the results to be displayed in the sidebars is it possible to somehow print into the sidebar? Thx for any kind of suggestion!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi nagyonbalogh,
    How about creating a widget where you’ll echo the results?
    That way your client can drag it to their sidebar in whatever position they want.

    http://codex.wordpress.org/Widgets_API#Developing_Widgets

    Shahar

    Thread Starter nagyonbalogh

    (@nagyonbalogh)

    Thanks for the reply. I have considered using a widget, but since this little project is part of an application process for a part time student job I wrote to the company asking them if using a widget would be OK with them cause they’re the ones who came up with the exercise anyways 🙂 Anyways, thx again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to echo some text in the sidebar using a regular plugin’ is closed to new replies.