Title: Wordwrap Question
Last modified: August 22, 2016

---

# Wordwrap Question

 *  Resolved [magace](https://wordpress.org/support/users/magace/)
 * (@magace)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/)
 * Hello I love the theme it looks great on my website:
    [http://ofchant.com/](http://ofchant.com/)
 * However is there any way to turn off word wrap?
    I use a plugin to pull data 
   from a txt file. Here is a example of how the data looks: [http://ofchant.com/logs/archive.txt](http://ofchant.com/logs/archive.txt)
   As you can see the text is formatted line by line.
 * However when I display the file on my website I get this:
    [http://ofchant.com/free-accounts/account-archive/](http://ofchant.com/free-accounts/account-archive/)
   As you can see the text is wrapped up making it unreadable.
 * I tried different aligns with no luck.
    I assume this is a setting in the theme
   because previous themes I have used displayed the data correctly line for line.
 * Thanks and willing to donate for help. I really want this to work on this theme!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Theme Author [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/#post-5204018)
 * When archive.txt paste at entry content
 * [https://gist.github.com/35fc070353dde4e7a23f.git](https://gist.github.com/35fc070353dde4e7a23f.git)
 * You seem to insert text in a special way that uses a hook and　…
 * At that time, I’m not such that a process such as removing the line breaks?
 *  Thread Starter [magace](https://wordpress.org/support/users/magace/)
 * (@magace)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/#post-5204120)
 * I tried using breaks in the archive.txt to force a new line however that did 
   not work.
 *  Theme Author [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/#post-5204180)
 * If you do not have him explicitly what, how was implemented and archive.txt, 
   it is not possible to reply
 * Raindrops theme does not have such processing remove the line breaks, except 
   for special cases, such as custom format chat
 *  Thread Starter [magace](https://wordpress.org/support/users/magace/)
 * (@magace)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/#post-5204267)
 * Hello I am confused on what you are saying.
    Archive.txt looks like this:
 *     ```
       08/20/2014: Free Account #1 Account Name: ofmulesasda1
       08/21/2014: Free Account #2 Account Name: 9nNsoXSY551
       08/22/2014: Free Account #2 Account Name: r7cGRe5gDd1
       ```
   
 * When I display the data I get this:
    `08/20/2014: Free Account #1 Account Name:
   ofmulesasda1 08/21/2014: Free Account #2 Account Name: 9nNsoXSY551 08/22/2014:
   Free Account #2 Account Name: r7cGRe5gDd1`
 * I switched to the twentyfourteen theme and it displays the data correctly.
    Is
   there no way to edit the default template to display the data correctly?
 * twentyfourteen default page template:
 *     ```
       <?php
       /**
        * The template for displaying all pages
        *
        * This is the template that displays all pages by default.
        * Please note that this is the WordPress construct of pages and that
        * other 'pages' on your WordPress site will use a different template.
        *
        * @package WordPress
        * @subpackage Twenty_Fourteen
        * @since Twenty Fourteen 1.0
        */
   
       get_header(); ?>
   
       <div id="main-content" class="main-content">
   
       <?php
       	if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
       		// Include the featured content template.
       		get_template_part( 'featured-content' );
       	}
       ?>
       	<div id="primary" class="content-area">
       		<div id="content" class="site-content" role="main">
   
       			<?php
       				// Start the Loop.
       				while ( have_posts() ) : the_post();
   
       					// Include the page content template.
       					get_template_part( 'content', 'page' );
   
       					// If comments are open or we have at least one comment, load up the comment template.
       					if ( comments_open() || get_comments_number() ) {
       						comments_template();
       					}
       				endwhile;
       			?>
   
       		</div><!-- #content -->
       	</div><!-- #primary -->
       	<?php get_sidebar( 'content' ); ?>
       </div><!-- #main-content -->
   
       <?php
       get_sidebar();
       get_footer();
       ```
   
 * Raindrops default page:
 *     ```
       <?php
       /**
        * Template for display page
        *
        *
        * @package Raindrops
        * @since Raindrops 0.1
        *
        * @uses raindrops_show_one_column( )
        * @uses add_filter( )
        * @uses get_header( )
        * @uses raindrops_yui_class_modify( )
        * @uses have_posts( )
        * @uses the_post( )
        * @uses the_ID( )
        * @uses raindrops_post_class( )
        * @uses the_title_attribute( )
        * @uses raindrops_entry_title( )
        * @uses raindrops_entry_content( )
        * @uses wp_link_pages( )
        * @uses the_category( ', ' )
        * @uses edit_post_link( )
        * @uses raindrops_delete_post_link( )
        * @uses comments_template( '', true )
        * @uses next_posts_link( )
        * @uses previous_posts_link( )
        * @uses get_sidebar( 'extra' )
        * @uses get_sidebar( 'default' )
        * @uses get_footer( $raindrops_document_type )
        * @uses raindrops_prepend_default_sidebar( )
        * @uses raindrops_append_default_sidebar( )
        * @uses the_post_thumbnail( )
        */
       if ( !defined( 'ABSPATH' ) ) {
           exit;
       }
       do_action( 'raindrops_' . basename( __FILE__ ) );
       $raindrops_current_column = raindrops_show_one_column();
   
       if ( $raindrops_current_column !== false ) {
           add_filter( "raindrops_theme_settings__raindrops_indv_css", "raindrops_color_type_custom" );
       }
   
       get_header( $raindrops_document_type );
       do_action( 'raindrops_pre_' . basename( __FILE__ ) );
       raindrops_debug_navitation( __FILE__ );
       ?>
       <div id="yui-main">
           <div class="yui-b <?php raindrops_add_class( 'yui-b' ); ?>">
                       <?php get_template_part( 'widget', 'sticky' ); ?>
               <div class="<?php echo raindrops_yui_class_modify(); ?>" id="container">
                   <div class="yui-u first<?php raindrops_add_class( 'yui-u first', true ); ?>" <?php raindrops_doctype_elements( '', 'role="main"' ); ?>>
                       <?php
                       if ( have_posts() ) {
   
                           while ( have_posts() ) {
   
                               the_post();
   
                               printf( '<!--%1$s-->', $raindrops_document_type );
                               ?>
                               <div class="entry page">
                                   <<?php raindrops_doctype_elements( 'div', 'article' ); ?> id="post-<?php the_ID(); ?>" <?php raindrops_post_class(); ?>>
   
                                   <?php
                                   raindrops_entry_title();
                                   ?>
                                   <div class="entry-content">
                                       <?php
                                       raindrops_prepend_entry_content();
   
                                       the_post_thumbnail( 'full', 'class=page-featured-image' );
   
                                       raindrops_entry_content();
                                       ?>
                                       <br class="clear" />
                                       <?php
                                       raindrops_append_entry_content();
                                       ?>
                                   </div>
                                   <div class="linkpage clearfix">
                                       <?php
                                       wp_link_pages( 'before=<p class="pagenate">&after=</p>&next_or_number=number&pagelink=<span>%</span>' );
                                       ?>
                                   </div>
                                   <br class="clear" />
                                   <div class="postmetadata">
                                       <?php
                                       the_category( ', ' );
   
                                       echo "&nbsp;";
   
                                       edit_post_link( esc_html__( 'Edit', 'Raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '<span class="edit-link">', '</span>' );
   
                                       raindrops_delete_post_link( esc_html__( 'Trash', 'Raindrops' ) . raindrops_link_unique( 'Post', $post->ID ), '<span class="edit-link">', '</span>' );
                                       ?>
                                   </div>
                                   <?php
                                   comments_template( '', true );
                                   ?>
                                   </<?php raindrops_doctype_elements( 'div', 'article' ); ?>>
                               </div>
                               <?php
                           } //endwhile 
   
                           raindrops_next_prev_links( "nav-below" );
                       } //end have post
                       ?>
                   </div>
                   <?php
                   if ( 3 == raindrops_show_one_column() ) {
                       ?>
                       <div class="yui-u">
                           <?php
                           raindrops_prepend_extra_sidebar();
   
                           get_sidebar( 'extra' );
   
                           raindrops_append_extra_sidebar();
                           ?>
                       </div>
                       <?php
                   } elseif ( $rsidebar_show && false == $raindrops_current_column ) {
                       ?>
                       <div class="yui-u">
                           <?php
                           raindrops_prepend_extra_sidebar();
   
                           get_sidebar( 'extra' );
   
                           raindrops_append_extra_sidebar();
                           ?>
                       </div>
                       <?php
                   }
                   ?>
               </div>
           </div>
       </div>
       <?php
       if ( raindrops_show_one_column() !== '1' || false == $raindrops_current_column ) {
           ?>
           <div class="yui-b">
               <?php
               //lsidebar start
               raindrops_prepend_default_sidebar();
   
               get_sidebar( 'default' );
   
               raindrops_append_default_sidebar();
               ?>
           </div>
           <?php
       }
       ?>
       </div>
       <?php get_footer( $raindrops_document_type ); ?>
       ```
   
 * Plugin used to retrive data:
 *     ```
       <?php
       /*
       Plugin Name: Retrieve Data
       Plugin URI: http://www.dagondesign.com/articles/retrieve-data-plugin-for-wordpress
       Description: Import data files into posts and pages
       Author: Dagon Design
       Version: 1.0
       Author URI: http://www.dagondesign.com
       */
   
       $ddrd_version = '1.0';
   
       // Setup defaults if options do not exist
       add_option('ddrd_data', '<!-- trigger1 -->*%*DELIM*%*data/test.txt*%*DELIM*%*<!-- trigger2 -->*%*DELIM*%*http://example.com/test.txt'); 
   
       function ddrd_arr($i) {
   
       }
   
       function ddrd_add_option_pages() {
       	if (function_exists('add_options_page')) {
       		add_options_page('Retrieve Data', 'DDRetrieveData', 8, __FILE__, 'ddrd_options_page');
       	}
       }
   
       function ddrd_options_page() {
   
       	$extra_fields = 3;
   
       	global $ddrd_version;
   
       	if (isset($_POST['set_defaults'])) {
       		echo '<div id="message" class="updated fade"><p><strong>';
   
       		update_option('ddrd_data', '<!-- trigger1 -->*%*DELIM*%*data/test.txt*%*DELIM*%*<!-- trigger2 -->*%*DELIM*%*http://example.com/test.txt'); 
   
       		echo 'Default Options Loaded!';
       		echo '</strong></p></div>';
   
       	} else if (isset($_POST['info_update'])) {
   
       		echo '<div id="message" class="updated fade"><p><strong>';
   
       		$tmp_data = array();
       		foreach ($_POST as $k => $v) {
       			if (strpos($k, 'ddrd_data') === 0) {
       				$tmp_data[] = $v;
       			}
       		}
   
       		$new_data = array();
       		for ($i = 0; $i < count($tmp_data); $i += 2) {
   
       			$d1 = ''; if (isset($tmp_data[$i])) $d1 = trim($tmp_data[$i]);
       			$d2 = ''; if (isset($tmp_data[$i+1])) $d2 = trim($tmp_data[$i+1]);
   
       			if (($d1 != '') || ($d2 != '')) {
       				$new_data[] = $d1;
       				$new_data[] = $d2;
       			}
       		}
   
       		$ddrd_data = implode('*%*DELIM*%*', $new_data);
   
       		update_option('ddrd_data', (string)$ddrd_data); 
   
       		echo 'Configuration Updated!';
       		echo '</strong></p></div>';
   
       	} ?>
   
       	<div class=wrap>
   
       	<h2>Retrieve Data v<?php echo $ddrd_version; ?></h2>
   
       	<p>For information and updates, please visit:<br />
       	<a href="http://www.dagondesign.com/articles/retrieve-data-plugin-for-wordpress/">http://www.dagondesign.com/articles/retrieve-data-plugin-for-wordpress/</a></p>
   
       	<p><strong>Note:</strong> If you need more fields, click 'Update Options' after making your changes, and more will be shown.</p>
   
       	<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
       	<input type="hidden" name="info_update" id="info_update" value="true" />
   
       	<fieldset class="options">
       	<hr />
       	<table width="100%" border="0" cellspacing="0" cellpadding="6">
   
       	<?php 
   
       	$ddrd_data = stripslashes(htmlspecialchars(get_option('ddrd_data')));
       	$ddrd_data = (array)explode('*%*DELIM*%*', $ddrd_data);
   
       	echo '<tr valign="top">
       	<td width="15%">
       		<strong>Trigger Text</strong>
       	</td>
       	<td align="left">
       		<strong>Data File</strong> (file relative to base WP path, or remote URL)
       	</td></tr>';
   
       	for ($i = 0; $i < count($ddrd_data) + ($extra_fields * 2); $i+=2) {
   
       		$d1 = ''; if (isset($ddrd_data[$i])) $d1 = trim($ddrd_data[$i]);
       		$d2 = ''; if (isset($ddrd_data[$i+1])) $d2 = trim($ddrd_data[$i+1]);
   
       		?>
       		<tr valign="top">
       		<td width="15%">
       			<input name="ddrd_data<?php echo $d1; ?>" type="text" size="18" value="<?php echo $d1; ?>"/>
       		</td>
       		<td align="left">
       			<input name="ddrd_data<?php echo $d2; ?>" type="text" size="70" value="<?php echo $d2; ?>"/>
       		</td>
       		</tr>
       		<?php
   
       	}
   
       	?>
   
       	</table>
       	</fieldset>
   
       	<div class="submit">
       		<input type="submit" name="set_defaults" value="<?php _e('Load Default Options'); ?> &raquo;" />
       		<input type="submit" name="info_update" value="<?php _e('Update options'); ?> &raquo;" />
       	</div>
   
       	</form>
       	</div><?php
       }
   
       function ddrd_fetch_data($url) {
       	return htmlspecialchars(file_get_contents($url));
       }
   
       function ddrd_check($content) {
   
       	$ddrd_data = (array)explode('*%*DELIM*%*', get_option('ddrd_data'));
   
       	for ($i = 0; $i < count($ddrd_data); $i += 2) {
       		if (isset($ddrd_data[$i]) && isset($ddrd_data[$i+1])) {
       			if ((trim($ddrd_data[$i]) != '') && (trim($ddrd_data[$i+1]) != '')) {
   
       				if (strpos($content, $ddrd_data[$i]) !== FALSE) {
       					$content = str_replace($ddrd_data[$i], ddrd_fetch_data($ddrd_data[$i + 1]), $content);
       				}
       			}
       		}
       	}
   
       	return $content;
       }
   
       add_action('admin_menu', 'ddrd_add_option_pages');
       add_filter('the_content', 'ddrd_check');
   
       ?>
       ```
   
 * Thanks for having a look!
 *  Theme Author [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/#post-5204280)
 * Sorry reply too late
 *     ```
       function ddrd_check($content) {
   
       	$ddrd_data = (array)explode('*%*DELIM*%*', get_option('ddrd_data'));
   
       	for ($i = 0; $i < count($ddrd_data); $i += 2) {
                    ...
               }
   
       	return wpautop( $content );// add wpautop
       }
       ```
   
 * Thank you

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Wordwrap Question’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/raindrops/1.700/screenshot.png)
 * raindrops
 * [Support Threads](https://wordpress.org/support/theme/raindrops/)
 * [Active Topics](https://wordpress.org/support/theme/raindrops/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/raindrops/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/raindrops/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [nobita](https://wordpress.org/support/users/nobita/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/wordwrap-question/#post-5204280)
 * Status: resolved