How can I stop the plugin to wrap other elements with which are not related?

This topic contains 2 reply and 2 voices, and was last updated by sjeev 10 years, 3 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
January 18, 2014 at 7:26 pm 14564
sjeev The plugin wraps everything in the post-meta with it's <ul> and treat like it's own custom fields. If the post-meta has div and span elements, the plugin wraps them too. That makes the code invalid and the page looks ugly if it wraps all the divs which are not related to WPUF. For example, if I have related_posts plugin and add_this plugins installed and their content will also be wrapped by your plugin. And the code looks like this:
<div class="post-content">
   <p> </p>
   <p> </p>
      <ul class="wpuf_customs">
           <li>
           <li>
               <label>test</label>
                        : test
           </li>

           <ul> other plugin content	
           </ul>
           <ul> <div> <span>other plugin content</span>
                 <span>other plugin content</span>
                </div>	
           </ul>
      </ul>
I managed to separate the div elements from the plugin's class="wpuf_customs" using jquery. But that causes another trouble on posts loop.
jQuery(document).ready(function () {
    var plugin = jQuery('.wpuf_customs');
    plugin.find('>ul').children().insertAfter(plugin)
});
So I had to remove the entire function wpuf_show_meta_front in the plugin file. Can you provide a solution to stop the plugin wrapping elements which are not related to it? Thanks!
January 19, 2014 at 12:51 pm 14576
Tareq Hasan Tareq Hasan

That shouldn’t be the case.

It only wraps them in that <ul> only if they are added via the custom field option from the admin panel. The error might happen because some of the items have mismatched <div> tag and I haven’t seen this weird thing anywhere. Only the mismatched tag might be the issue IMO.

January 19, 2014 at 5:13 pm 14585
sjeev sjeev

Hello Tareq,

It wraps every element which is not related to WPUF after the plugin’s custom fields.

Viewing 2 Posts - 1 through 2 (of 2 total)