WordPress.org

Ready to get started?Download WordPress

Forums

PHP Code Widget
Rename PHP Code widgets in sidebar? (11 posts)

  1. bobjones
    Member
    Posted 3 years ago #

    Otto, thanks for the great plugin.

    I now have a long column of "PHP Code" widgets in my sidebar on the Widgets Admin page. Can't tell what's in them without opening each one.

    Is there any way to edit the label so I can identify each widget?

    Thanks!

  2. nmfrazer
    Member
    Posted 3 years ago #

    Like you, I have numerous instances of this plugin. I love it! I'm sure this is probably a dirty hack, but it solved the problem for me. I wanted to see the title on the widgets admin page, but not on the site. I used Mozilla Firebug to identity the widget, css area, etc. In my case it was div#execphp-15, widget-title h3. I use Atahualpa theme, so in my CSS options I added the following.

    div#execphp-15 .widget-title h3{display:none !important;}

    I'm sure there are better ways of doing this, but it works. Hope my solution can help you.

  3. bobjones
    Member
    Posted 3 years ago #

    The widget title in the Sidebar area of the Widgets Admin page, which is the area about which I am concerned, carries a class of widget-title h4.

    I'm not interested in removing the title. I'm interested in personalizing the label for each widget.

    Please take some time to read the question before you try to answer it!

  4. nmfrazer
    Member
    Posted 3 years ago #

    LOL. I did read your question and I merely misunderstood what you are attempting to do. I apologize. Hopefully, the next answer will be more helpful. :)

  5. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    Honestly, the PHP Code widget is a bit of a hack and I discourage people from using it. The only reason I leave it around is because it's such a *useful* little hack, you know? It was only meant to be used for temporary usage. When widgets were new, it came in handy to migrate from hardcoded sidebars to widgets easily.

    So no, there's no good way to personalize the labels. Realistically, I'd try to transition away from using the PHP Code widget and try to use normal widgets as much as possible.

  6. bobjones
    Member
    Posted 3 years ago #

    What are you,crazy, Otto? Your PHP Code Widget is the only one that works! I'm not giving it up.

    Seriously, I use PHP content in my sidebars, and I'm using a widgetized sidebar. As far as I know, thanks to the squirrelyness of WordPress, there isn't any other way to post PHP content in a widgetized sidebar other than through a widget such as yours.

  7. Workshopshed
    Member
    Posted 3 years ago #

    The same problem occurs with the text widget, if you've got several of them with no title then you can't tell the difference.

  8. bobjones
    Member
    Posted 3 years ago #

    Really, Workshopshed? That's fascinating.

    However, if you'll just check the subject and the thread, you'll see we're discussing the PHP Code Widget.

  9. Workshopshed
    Member
    Posted 3 years ago #

    I believe that the issue is generic to widgets and not specific to the PHP Code Widget, the label that is displayed on the dashboard is the title and that's also what appears before the widget. There is no separate comment/name field that you can use to tag your widgets. As nmfrazer mentions the work around is to specifically suppress the display of these titles in CSS.

    You could recode the PHP Code Widget to have a new "title2" field and the display that instead of the "title" field which would simply be used as a label. The form to input the data would need to double up and have both title with the caption "label" and title2 with the caption "title"

  10. karban
    Member
    Posted 3 years ago #

    Hi,
    Luckily there is a much simpler solution :-)

    Type in a descriptive name for the widget, press "Save", and then delete the title & press "Save" again........ Fixed!

    You'll find that the title name still remains listed at the top of the module, and so you don't have to open each one to see what it is (...very annoying I agree) however the title will not display on the front-end....

    Cheers.

  11. Workshopshed
    Member
    Posted 3 years ago #

    I tried that but after you exit and return the labels do seems to be lost.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic