n my sidebar every widget title is enclosed in <h2> tags.

I use 4 widgets in my sidebar and I'd like to have the first 2 widget titles as <h2> and the other 2 as <h4>.

I changed in my function.php as given below:

'before_title' => '<h4>', 
'after_title' => '</h4>',

but that changes all titles.
How can I solve this issue?

Recommended Answers

All 2 Replies

Hard to say without seeing how the settings are applied to your widgets.

leave the original sidebar as it is, you can register a new sidebar, configure the new sidebar to have <h4> ... before_title' => '<h4>', 'after_title' => '</h4>',.. etc.. and then add the required widget in new sidebar..
you can then include both the sidebars if you want

makes sense?

commented: This not the right way to do this I want that dynamically and it is possible. +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.