Jump to content

Archived

This topic is now archived and is closed to further replies.

golok

Content's line returns not displayed

Recommended Posts

golok    1
golok

I am facing a weird problem with PageLines Framework 2.4 and WordPress 3.8; line returns are disappearing on posts although they are still present in the editor (be it in visual or text mode) after saving.

As you can see from the following screenshots, this problem doesn't occur with WP built-in themes (twentytwelve, twentythirteen and twentyfourteen), but exclusively on PageLines' default theme, even after disabling all plugins.

 

twentyfourteen.jpg

In WP's twentyfourteen theme

pagelines.jpg

In PageLines default theme

 

Could it has something to do with the "wpautop" function? In the "class.shortcodes.php" file, the following code can be found:

	function filters() {

		/**
		 *  Prevent AUTOP inside of shortcodes (breaking shortcodes - removed)
		 */
		remove_filter( 'the_content', 'wpautop' );
		add_filter( 'the_content', 'wpautop' , 12);		
		remove_filter( 'the_content', 'wptexturize' );
		add_filter( 'the_content', 'wptexturize' , 12);
	}

Thanks in advance for any help.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

HI,

 

Can you show us (screenshot) what is in the editor for that page please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
golok    1
golok

Hi Danny,

 

below are the screenshots of the editor.

text_editor.jpg

visual_editor.jpg

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

I have just tested this on my test site using PageLines Framework 2.4.4 and Wordpress 3.8, I have no such issue.

 

http://d.pr/i/XYop

 

Therefore, its likely that you have a plugin causing a conflict, on my test site I have no plugins.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
golok    1
golok

Weird… As previously mentioned, I had deactivated all my plugins… Furthermore, after reading your answer and your framework version, I updated my PageLines Framework from 2.4 to 2.4.4 — just in case. But to no avail… Line returns are still not displayed…

Share this post


Link to post
Share on other sites
golok    1
golok

Danny,

 

On another install, using the Base Theme 1.0.2, I managed to get the line returns via the following code, using the wpautop function mentioned above:

<?php $content = get_the_content($ID); ?>
<div class="entry"><p><?php echo wpautop($content); ; ?></p></div>

So I think my first guess was correct: it must have something to do with the "wpautop", isn't?

Share this post


Link to post
Share on other sites
Simon    247
Simon

The screenshot shows an excerpt not the actual post. If you want p tags allowed in excerpts then you have to add p to the allowed excerpt tags in the settings area.

 

That filters function is not actually used anywhere.

Share this post


Link to post
Share on other sites

  • Similar Content

    • glennyboy
      By glennyboy
      Hi
       
      For some time I've experienced difficulties with shortcodes within DMS sections having erroneous <p> tags wrapped around elements, often breaking the code or causing conflicts with the correct short code functioning (often requiring a workaround). I've now realised that this is most probably DMS's application of wpautop.
       
      It seems that the solution to stopping Wordpress adding wpautop to short codes is adding the following lines to functions.php:-
       
      //move wpautop filter to AFTER shortcode is processed remove_filter( 'the_content', 'wpautop' ); add_filter( 'the_content', 'wpautop' , 99); add_filter( 'the_content', 'shortcode_unautop',100 ); However this doesn't work. I'm guessing this is as I am using a child theme of DMS which is overriding the wpautop settings. Can you please reorder wpautop priority in DMS or advise how to stop DMS wrapping short codes with wpautop.
       
      Thanks
       
      Glennyboy
       
×