WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] where is the widget xhtml? (5 posts)

  1. micky1
    Member
    Posted 3 years ago #

    When using firebug I can easily see the xhtml that is driving the content of the sidebar widgets. (Usually in the form of h2 and ul and li etc.) What file holds that actual xhtml for these widgets. It certainly isn't in the sidebar.php file or any of the other files that I can find.

    Any help on the normal location of this html would be greatly appreciated.

    Cheers.

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    /wp-includes/default-widgets.php

    editing wp core templates is not recommmended, as edits will be overwritten with the next upgrade of wp.

    there is usually another way of doing things.

    part of the html markup is controlled by 'register_sidebar()' in functions.php of the theme.
    http://codex.wordpress.org/Function_Reference/register_sidebar

  3. micky1
    Member
    Posted 3 years ago #

    Thanks for that. Much appreciated! Why I am trying to achieve is to put a footer image (as a bg) at the bottom of each widget section. I have placed a bg "header image" in the h2 element and a repeating bg behind each widget, but the footer bit of the design is offering me plenty of challenges. Hopefully this is only down to my lack of experience with designing for WordPress.
    Cheers.

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    register_sidebar() has the 'after_widget' parameter where you can possibly enter an extra span or whatever you might need for your design.

  5. micky1
    Member
    Posted 3 years ago #

    Thanks alchymyth. Your help led me to a fabulous article/tutorial by Justin Tadlock that unravelled the complete mystery of styling widgets.

    I would definitely recommend this to any new (or not so new) theme developer.
    Here's the link;

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic