Support » Plugins » How add PHP in sidebar when using widget

  • Resolved meethere


    Hi i have installed sidebar widget yesterday.

    I have a php code below to show my clients advertisement:

    <?php include 'inblogads.php' ?>

    Previously when i was not using sidebar widget, i was able to show those ads by putting the above code in sidebar.php of the template.

    But now i am not able to do so. Adding the code in the text box widget also dont work because it can display only text/html contents.

    Also i can add available widget buttons to sidebar but cannot drag back when i dont need them.

    Please please help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Use my ExecPHP widget, available here:

    It’s just like a text box widget, but it’ll also run PHP code.

    I don’t know why you can’t drag them back. Try dragging them all the way down to the bottom, until they change shape for the unused widget space below.

    That’s crazy, what possible reason is there for forcing us to use such a kludge to run PHP in the sidebar?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    relaxedguy: If you don’t want to use it or to use widgets, then don’t. Nobody’s forcing you.

    However, having widgets makes things nicer. No having to deal with PHP to rearrange sidebars. No having to move your hacked sidebar code to a new theme if you change themes (as long as the new theme supports widgets, anyway). Etc, etc…

    Perhaps I was not clear. Of course I want to use widgets, who wouldn’t? Problem is the widget management system is very crude in terms of functionality. I was rallying against having to run yet another plug-in to enable PHP in widgets, which are built in PHP? The redundancy is weird and unnecessary. I can see blocking PHP in posts and comments, but the sidebar?

    The main reason for using phpexec is that I want to add php ads in the sidebar.
    Hope you got it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How add PHP in sidebar when using widget’ is closed to new replies.