WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Line breaks and paragraphs disappears after publishing page (11 posts)

  1. ShigueS
    Member
    Posted 2 years ago #

    Hello,

    I am building a custom theme on my multisite installation of wordpress. Whenever I create a new page I can't add paragraphs or line breaks in the text. Well I can see them, but after hitting the preview/publish button the text collapse into a single block (on the edit screen, inside wordpress). When I preview it on the actual page, it is all collapsed too.

    The strange part of it is that it won't happen when I create a post. On post edit screen everything works fine. After publishing/previewing the text, the line breaks and paragraphs still where I put them.

    Maybe is something related to the database. I have the phpMyadmin plugin installed and I changed some tables' collation to utf8_general_ci because I had problems with japanese characters.

    I am really lost here and would appreciate if anyone could help me.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    What is your theme's page.php using to display the page content?

  3. ShigueS
    Member
    Posted 2 years ago #

    You mean the code? Is like this:

    <?php get_header(); ?>
    
    		<div id="primary" class="grid_8">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'page' ); ?>
    
    					<?php comments_template( '', true ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Looks like your theme uses the content-page.php template file to output the pages content. You will need to look in that file.

  5. ShigueS
    Member
    Posted 2 years ago #

    Ok, Thank you for helping.

    The content of the content-page.php is this:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    	</header><!-- .entry-header -->
    
    	<div class="entry-content softShadow">
    		<?php the_content(); ?>
    		<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'toolbox' ), 'after' => '</div>' ) ); ?>
    		<?php edit_post_link( __( 'Edit', 'toolbox' ), '<span class="edit-link">', '</span>' ); ?>
    	</div><!-- .entry-content -->
    </article><!-- #post-<?php the_ID(); ?> -->
  6. esmi
    Forum Moderator
    Posted 2 years ago #

    There's nothing wrong with that code. <?php the_content(); ?> will output the formatted page content. And given that I've used the Toolbox theme, I know that the template works just fine. Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

  7. ShigueS
    Member
    Posted 2 years ago #

    Ok. Thank you esmi!

    I will try those procedures and let you know!

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    Is this a child theme or the parent Toolbox theme? If it's the latter, have you modified the theme in any way?

  9. ShigueS
    Member
    Posted 2 years ago #

    I have modified the theme.

  10. ShigueS
    Member
    Posted 2 years ago #

    I have done what you suggested. The very first plugin I had activated seems to be the problem: qTranslate. If it is on, the paragraphs won't work. If I turn it off... it works...

  11. ShigueS
    Member
    Posted 2 years ago #

    FIXED! It was a qTranslate plugin bug.

    I got the solution from here: http://wordpress.stackexchange.com/questions/42877/qtranslate-2-5-28-and-wordpress-3-3-1-issues/45371#45371

    Thank you esmi!

Topic Closed

This topic has been closed to new replies.

About this Topic