• In the current WordPress version 6.3.1, how do I add span between the opening and closing widget title? Presently, it takes this form

    <h2></h2> and what I want to achieve is

    <h2><span></span></h2>.

    Can somebody explain to me on how to customise the core WordPress code to achieve this? Alternately, is there any way to get this done?

    I attempted customising the below code and seem not to get the desire result.

    <span style="font-size: inherit; font-family: inherit;">register_sidebar(<span style="mso-tab-count:2">??????????????????????????????? </span>array(<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'name'<span style="mso-spacerun:yes">????????? </span>=> esc_html__( 'Sidebar 1',</span>

    'oza-themes' ),<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'id'<span style="mso-spacerun:yes">??????????? </span>=> 'sidebar-1',<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'description'<span style="mso-spacerun:yes">?? </span>=> esc_html__( 'Add widgets here.', 'oza-themes' ),<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'before_widget' => '<section id="%1$s" class="widget<span style="mso-spacerun:yes">? </span>shadow-lg %2$s">',<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'after_widget'<span style="mso-spacerun:yes">? </span>=> '</section>',<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'before_title'<span style="mso-spacerun:yes">? </span>=> '<h2 class="widget-title"><span>',<span style="mso-tab-count:3">??????????????????????????????????????????????? </span>'after_title'<span style="mso-spacerun:yes">?? </span>=> '</span></h2>',<span style="mso-tab-count:2">??????????????????????????????? </span>)<span style="mso-tab-count:1">??????????????? </span>);?

    • This topic was modified 1 year, 5 months ago by bcworkz. Reason: formatting fixed
Viewing 2 replies - 1 through 2 (of 2 total)
  • The answer depends on which theme you are using?

    Moderator bcworkz

    (@bcworkz)

    Altering a block’s HTML usually means building a custom block, or inserting it via script.

    You shouldn’t need span tags to achieve most effects. Usually appropriate CSS alone will suffice. What is the end result that you hope to achieve with this?

    If you’re hoping for specific CSS suggestions, we would need a live link to a representative page because such a solution is theme dependent.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add span in between h2 widget title’ is closed to new replies.