Widget Shortcode
[resolved] Before/After title and widget functions are not working (10 posts)

  1. intheshallow
    Posted 3 years ago #

    I noticed that when I add anything to before/after title or widget in the init.php file, that they are not taking.

    Can you check on this?


  2. shazdeh
    Plugin Author

    Posted 3 years ago #

    The syntax is like this: [widget id="meta-1" before_title="<h3>" after_title="</h3>"]
    This is working for me. What seems to be the problem?

  3. intheshallow
    Posted 3 years ago #


    If you look at the word "test" and the links below it, it's not acting as it should.

    This is what I have in the init.php file:

    'before_widget' => '<ul class="top-sub-menu">',
    'after_widget' => '',
    'before_title' => '<h3>',
    'after_title' => '</h3>'

    None of this is taking.

  4. intheshallow
    Posted 3 years ago #

    Oh, you enter it in the actual code, my bad. Next time can you make sure to point this out in examples on your plugin?

  5. shazdeh
    Plugin Author

    Posted 3 years ago #

    Sorry for the inconvenience.

  6. mbauerHaL
    Posted 3 years ago #

    My code on the page looks like this:

    [widget id="recent-posts-2" before_title="<h3>" after_title="</h3>"]

    This put an actual <h3> before the title and a </h3> after the title on the page as if they were part of the title. Like I called the widget "<h3>title</h3>?

    What am I doing wrong?

  7. shazdeh
    Plugin Author

    Posted 3 years ago #

    Nothing, that's how it's supposed to work. How should it be?
    If you don't want the before_title and after_title parameters just set them to nothing:
    [widget id="recent-posts-2" before_title="" after_title=""]
    So now nothing will wrap the widget title.
    Let me know if you need any help.

  8. mbauerHaL
    Posted 2 years ago #

    Instead of using the <h3></h3> tags to control the title font and size it actually puts <h3> and </h3> as part of the title.

    like this

    This is what my code looks like on the page:
    [widget id="archives-2" before_title="<h3>" after_title="</h3>"]

  9. shazdeh
    Plugin Author

    Posted 2 years ago #

    Have you entered the shortcode in Visual mode in editor? Because in visual mode the editor converts less-than and greater-than signs to their unicode equivalent so they show up as you typed them.
    Try that in Source mode and let me know if that helps. I'll update the plugin with a fix to solve this.

  10. mbauerHaL
    Posted 2 years ago #

    Yes I was entering the code in visual editor mode.

    It does seems to work when in html editor mode. It then makes the visual editor mode look really funky, but seems to work.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Widget Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic