• I am pretty new to WP. I’ve searched the web for an answer to this problem. Couldn’t find one. I’m using this dynamic widget thing (Appearance>Widgets) where I can drag and drop the widgets. I’d like to change some HTML code in some of these widgets, but I cannot find the code which creates these them. It’s not in the sidebar.php; this file can be made completely empty and the sidebar and widgets still appears. Could someone point me to the place/files where the HTML of the dynamic widgets is generated.
    Thanks a lot. Regards.
    Fino.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Depends which widget. You’d need to dig through the plugin’s code.

    -WCC

    you’ll find the widget codes in:
    wp-includes/default-widgets.php

    be aware that changes in these wp core files will be lost when you upgrade to a new version.

    Thread Starter finofontana

    (@finofontana)

    Great! Thanks for the hint. Now I’m pondering about the following.

    I’ve found the code for Recent Comments (default_widgets.php: class WP_Widget_Recent_Comments):

    <ul id=”recentcomments”><?php …

    I’d like to change stuff here. F.e.: maybe I would like to use an
    ol tag instead of an ul tag. I could change it in default_widgets.php, but as alchymyth mentioned: these changes could be overwritten when upgrading WP. How could I make changes which are being kept during an upgrade. Can I do something with functions.php for example?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where is the widget code?’ is closed to new replies.