• I am creating a custom, but generic, theme. I wish to change the default sidebar calendar widget. The default title code is set as <h2> </h2> and I wish to have it as <h2>Calendar</h2>.

    I believe such a change involves writing a function in the functions.php file, but I am new to writing WordPress functions. I have searched and googled this and have not found the way to write such a function. Can someone please help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The content between <h1> and </h2> can be changed in the themes->widgets section when you drag the widgets. Not sure why you need to write a function to change it. Maybe I didn’t get your meaning..

    Thread Starter justmigrating

    (@justmigrating)

    Thank you, of course you are right! I wasn’t thinking well last night.

    Although what if I wanted the calendar caption (month and year) to be in the heading (<h2>May 2011</h2>) rather than in the table caption. The default calendar code begins…

    <div class=”widget”><h2>Calendar</h2><div id=”calendar_wrap”><table id=”wp-calendar” summary=”Calendar”><caption>May 2011</caption>

    Moving the month and year to the heading, would that require a function?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Write function to change sidebar calendar’ is closed to new replies.