Custom Post Widget
[resolved] Need feature to remove div in shortcode (4 posts)

  1. dimagsv
    Posted 2 years ago #

    I need a feature to remove div when content displayed using shortcode. I need to insert inline text. For ex.:
    Contact info: [content_block id=1234]
    [content_block id=1234] must be an inline element in my case.
    Can I make this with your plugin?


  2. Johan van der Wijk
    Plugin Author

    Posted 2 years ago #

    Hi dimagsv,

    Yes, you should be able to display the content block inline using css.

  3. dimagsv
    Posted 2 years ago #

    This can't be made using css. div is not allowed in p element by html specification.
    Contact info: [content_block id=1234]
    will be in html:
    <p>Contact info: <div><p>bla bla bla</p></div></p>
    , but browser will interpret this as
    <p>Contact info: </p><div><p>bla bla bla</p></div><p></p>
    Browser will auto close first p tag.

  4. Johan van der Wijk
    Plugin Author

    Posted 1 year ago #

    Unfortunately this cannot be done with the Custom Post Widget plugin. In line 184 of the file post-widget.php you can see that a div is always added around the embedded content block. You could of course remove lines 184 and 186 of the plugin, but when updating the plugin this will be undone.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.