Jump to content


Photo

Content showing twice in blog posts in eco pro


  • Please log in to reply
14 replies to this topic

#1 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 14 May 2012 - 03:12 PM

I was having a problem where the category page was only showing excerpts. So I changed some code in the loop. Now, the category page is fine, but every post is displaying the content twice. I assume it's something in the loop, which is here:
 <?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); // START OF THE LOOP ?>
	
		<div class="postwrap fix">
	
			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
				<?php if(is_single()): // Post to Post Navigation?>
					<div class="post-nav fix"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span></div>
				<?php endif;?>
	
				<?php if(!is_page()):?>
					<div class="copy fix">
						<?php if(pl_show_thumb($post->ID)): // Thumbnails ?>
			            		<div class="post-thumb">
									<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
										<?php the_post_thumbnail('thumbnail');?>
									</a>
					            </div>
						<?php endif; ?>
	
						<div class="post-header fix <?php if(!pl_show_thumb($post->ID) && !get_post_meta($post->ID, 'thumb', true)) echo 'post-nothumb'; // Adjust Width For No Thumb?>" style="">
							<div class="post-title-section fix">
								<div class="post-title fix">
									<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to',TDOMAIN);?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
									<div class="metabar">
										<em>
										<?php _e('On',TDOMAIN);?> <?php the_time(get_option('date_format')); ?>,
										<?php _e('in',TDOMAIN);?> <?php the_category(', ') ?>,
										<?php _e('by',TDOMAIN);?> <?php the_author(); ?>
										<?php edit_post_link(__('<strong>(Edit Post)</strong>', TDOMAIN), ' ', ' ');?>
										</em>
									</div>
								</div>
	
								<div class="post-comments">
									<a href="<?php the_permalink(); ?>#comments" title="<?php _e('View Comments', TDOMAIN);?>"><span><?php comments_number(0, 1, '%'); ?></span></a>
								</div>
							</div>
							<!--/post-title -->
	<?php the_content('Read more...'); ?>
	
							<?php if(pl_show_excerpt($post->ID)): // Post Excerpt ?>
									<div class="post-excerpt">
										<?php the_excerpt(); ?>
									</div>
	
									<?php if(is_home() && !pl_show_content($post->ID)): // 'Continue Reading' link ?>
										<a class="continuereading" href="<?php the_permalink(); ?>">
											<?php e_pagelines('post_footer_text', __('Continue Reading', TDOMAIN));?>
										</a>
	
									<?php endif;?>
							<?php endif; ?>
						</div>
					</div>
				<?php endif;?>
	
				<?php  if(pl_show_content($post->ID)): // Post and Page Content ?>
					<div class="copy fix">
						<div class="textcontent">
							<?php the_content(__('<p>Continue reading »</p>',TDOMAIN)); ?>
							<?php if(is_single()) wp_link_pages(__('<p><strong>Pages:</strong>', TDOMAIN), '</p>', __('number', TDOMAIN)); ?>
							<?php edit_post_link(__('Edit',TDOMAIN), '<p>', '</p>'); ?>
							<div class="clear"></div>
						</div>
						<div class="tags">
							<?php the_tags(__('Tagged with: ', TDOMAIN),' • ',''); ?>
						</div>
					</div>
					<?php if(pagelines('authorinfo') && is_single() && VPRO):?>
						<?php include(THEME_LIB.'/_authorinfo.php');?>
					<?php endif;?>
	
				<?php endif;?>
	
				<?php if(!is_page()) include(THEME_LIB.'/_post_footer.php');?>
			</div><!--post -->
	
		</div>
	
	
		<div class="clear"></div>
	
			<?php if(is_single() || is_page()): // Content sidebar and comments area ?>
	
				<?php if(VPRO) include(THEME_LIB."/_contentsidebar.php");?>
	
				<div class="postwrap <?php if(!have_comments() && 'open' != $post->comment_status) echo "nocommentform";?>">
					<div class="hentry">
						<div class="copy"> <?php comments_template();?></div>
					</div>
					
				</div>
	
			<?php endif; endwhile; ?>
	
		<?php include(THEME_LIB.'/_pagination.php');?>
	
	
		<?php else : // show this if 404 error or no post/page is returned ?>
			<div class="postwrap fix">
				<div class="hentry">
				<div class="billboard">
					<?php if(is_404()):?>
						<h2 class="center"><?php _e('Error 404 - Page Not Found',TDOMAIN);?></h2>
					<?php else:?>
						<h2 class="center"><?php _e('Nothing Found',TDOMAIN);?></h2>
					<?php endif;?>
					<p class="center"><?php _e('Sorry, what you are looking for isn't here.', TDOMAIN);?></p>
					<div class="center fix"><?php include (THEME_LIB . '/_searchform.php'); ?></div>
				</div>
				</div>
			</div>
	
	<?php endif; // end the loop ?>
Any help there?

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 14 May 2012 - 08:39 PM

What file did you edit?

#3 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 15 May 2012 - 02:58 PM

the_loop.php

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 16 May 2012 - 02:06 AM

What code in the file did you adjust? Did you change something or delete something from it?

#5 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 16 May 2012 - 03:57 AM

I added this: ?php the_content('Read more...'); ?

#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 16952 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 16 May 2012 - 10:27 AM

Hi Nick, You shouldn't edit the core files for this very reason and also, if an update is released these changes will be overwritten. I have provided a screencast below, check to see if your settings are to this, you probably have one option set as the same as the other and this is causing the double content. http://screencast.com/t/hQ4b8kFY

#7 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 16 May 2012 - 02:53 PM

That seems to make it so the /blog page shows the content once, but the single post page still shows the content twice: http://www.jennyandf...-the-ten-bells/ As for modifying the core files, I was following instructions given to me on this forum: http://www.pagelines...e-in-eco-pro/p1

#8 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 16 May 2012 - 03:19 PM

I decided to remove the code I added to the_loop.php because the blog looked really dumb. Now I am back to the start. The problem is the category page you see here: http://www.jennyandf...-natural-wines/ I would like to display the full content of the posts there. How can that be done?

#9 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 16 May 2012 - 07:46 PM

The settings for full excerpts can be set very easily in PageLines Framework. Please consider upgrading.

The setting for full content is set at Dashboard > EcoPro > Theme Options > Pages And Posts under "Full Post Content Placement" (scroll down) and check the option Show full content on all blog pages

That should do the trick.

#10 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 16 May 2012 - 10:51 PM

That box is already checked.This was already suggested above. I have checked that box and it does not affect the category page at all. I would be happy to upgrade if you give it to me for free.

#11 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 17 May 2012 - 02:11 AM

Have you tried deactivating any active plugins to see if the category page displays your content correctly? PageLines Framework is only available for free if you purchased PlatformPro developer license after September 15th.

#12 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 17 May 2012 - 03:00 AM

Just tried deactivating all plugins and the category page did not change. My comment about giving it to me for free was sarcastic. When I purchased eco pro originally it did come with lifetime support correct? This doesn't seem like a very complicated problem to correct. I imagine some type of code needs to be added to the loop. This should probably specify that if a certain category (or possibly all categories) are displayed, the full post content should be displayed. Can anyone tell me what that code should be?

#13 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 17 May 2012 - 03:06 AM

Sometimes the customer is serious about those things. ;) If the setting isn't working, perhaps try re-installing the theme to see if the problem persists, but first make sure you have your database backed up and if you made any other customizations and what not, those should be backed up, too. I'm not sure what code would be needed to display full post content (especially since it's not recommended that files should be left alone).

#14 nickgorevic

nickgorevic

    Member

  • Members
  • PipPip
  • 12 posts

Posted 17 May 2012 - 03:20 AM

I figured it out myself. I modified the category.php file. I took the code from the _template.php file, and replaced this code:
 <?php include (TEMPLATEPATH . '/_theloop.php
with the entire code of _the_loop.php. But I added in this code:
 <?php the_content('Read more...'); ?>
after
 <!--/post-title -->
and put that all into the category.php file. So now the category.php file looks like this:
 <?php
	
	
		if(is_page_template('page-fullwidth.php') || is_page_template('page-fullhighlight.php') || is_page_template('page-carousel-full.php') || is_page_template('page-feature-fullwidth.php')) $full_width_page = true;
		else $full_width_page = false;
	
		if(is_page_template('page-carousel.php') || is_page_template('page-carousel-full.php')) $carousel_page = true;
		else $carousel_page = false;
	
		if(VPRO && isset($post) && (is_page_template('page-feature.php') || is_page_template('page-feature-page.php') || is_page_template('page-feature-fullwidth.php') ||(is_home() && pagelines('featureblog')))) $featureslide_template = true;
		else $featureslide_template = false;
	
		if(VPRO && isset($post) && (is_page_template('page-feature.php') || (is_page_template('page-feature-fullwidth.php') || is_page_template('page-feature-page.php')) || m_pagelines('featureboxes', $post->ID))) $fboxes_template = true;
		else $fboxes_template = false;
	
	?>
	
	
	<?php get_header();?>
	
	<?php
		if($carousel_page) include(PAGELINES_PRO.'/template_carousel.php');
		elseif($featureslide_template) include(PAGELINES_PRO . '/template_feature.php');
		else require(THEME_LIB.'/_spotlight.php');
	?>
	<?php if(!is_404()) include(THEME_LIB.'/_sub_head.php');?>
	
	<div <?php if($full_width_page):?>id="fullwidth"<?php endif;?> class="contentcontainer fix">
		<div class="texture fix">
			<div class="content fix <?php if(pagelines('leftsidebar', $post->ID) || is_page_template('page-leftsidebar.php')):?>leftsidebar<?php endif;?>">
				<?php if($fboxes_template) include(PAGELINES_PRO . '/template_fboxes.php');?>
	
				<div id="maincontent"  >
	
					<?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); // START OF THE LOOP ?>
	
		<div class="postwrap fix">
	
			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
				<?php if(is_single()): // Post to Post Navigation?>
					<div class="post-nav fix"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span></div>
				<?php endif;?>
	
				<?php if(!is_page()):?>
					<div class="copy fix">
						<?php if(pl_show_thumb($post->ID)): // Thumbnails ?>
			            		<div class="post-thumb">
									<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
										<?php the_post_thumbnail('thumbnail');?>
									</a>
					            </div>
						<?php endif; ?>
	
						<div class="post-header fix <?php if(!pl_show_thumb($post->ID) && !get_post_meta($post->ID, 'thumb', true)) echo 'post-nothumb'; // Adjust Width For No Thumb?>" style="">
							<div class="post-title-section fix">
								<div class="post-title fix">
									<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to',TDOMAIN);?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
									<div class="metabar">
										<em>
										<?php _e('On',TDOMAIN);?> <?php the_time(get_option('date_format')); ?>,
										<?php _e('in',TDOMAIN);?> <?php the_category(', ') ?>,
										<?php _e('by',TDOMAIN);?> <?php the_author(); ?>
										<?php edit_post_link(__('<strong>(Edit Post)</strong>', TDOMAIN), ' ', ' ');?>
										</em>
									</div>
								</div>
	
								<div class="post-comments">
									<a href="<?php the_permalink(); ?>#comments" title="<?php _e('View Comments', TDOMAIN);?>"><span><?php comments_number(0, 1, '%'); ?></span></a>
								</div>
							</div>
							<!--/post-title -->
	
	<?php the_content('Read more...'); ?>
							<?php if(pl_show_excerpt($post->ID)): // Post Excerpt ?>
									<div class="post-excerpt">
										<?php the_excerpt(); ?>
									</div>
	
									<?php if(is_home() && !pl_show_content($post->ID)): // 'Continue Reading' link ?>
										<a class="continuereading" href="<?php the_permalink(); ?>">
											<?php e_pagelines('post_footer_text', __('Continue Reading', TDOMAIN));?>
										</a>
	
									<?php endif;?>
							<?php endif; ?>
						</div>
					</div>
				<?php endif;?>
	
				<?php  if(pl_show_content($post->ID)): // Post and Page Content ?>
					<div class="copy fix">
						<div class="textcontent">
							<?php the_content(__('<p>Continue reading »</p>',TDOMAIN)); ?>
							<?php if(is_single()) wp_link_pages(__('<p><strong>Pages:</strong>', TDOMAIN), '</p>', __('number', TDOMAIN)); ?>
							<?php edit_post_link(__('Edit',TDOMAIN), '<p>', '</p>'); ?>
							<div class="clear"></div>
						</div>
						<div class="tags">
							<?php the_tags(__('Tagged with: ', TDOMAIN),' • ',''); ?>
						</div>
					</div>
					<?php if(pagelines('authorinfo') && is_single() && VPRO):?>
						<?php include(THEME_LIB.'/_authorinfo.php');?>
					<?php endif;?>
	
				<?php endif;?>
	
				<?php if(!is_page()) include(THEME_LIB.'/_post_footer.php');?>
			</div><!--post -->
	
		</div>
	
	
		<div class="clear"></div>
	
			<?php if(is_single() || is_page()): // Content sidebar and comments area ?>
	
				<?php if(VPRO) include(THEME_LIB."/_contentsidebar.php");?>
	
				<div class="postwrap <?php if(!have_comments() && 'open' != $post->comment_status) echo "nocommentform";?>">
					<div class="hentry">
						<div class="copy"> <?php comments_template();?></div>
					</div>
					
				</div>
	
			<?php endif; endwhile; ?>
	
		<?php include(THEME_LIB.'/_pagination.php');?>
	
	
		<?php else : // show this if 404 error or no post/page is returned ?>
			<div class="postwrap fix">
				<div class="hentry">
				<div class="billboard">
					<?php if(is_404()):?>
						<h2 class="center"><?php _e('Error 404 - Page Not Found',TDOMAIN);?></h2>
					<?php else:?>
						<h2 class="center"><?php _e('Nothing Found',TDOMAIN);?></h2>
					<?php endif;?>
					<p class="center"><?php _e('Sorry, what you are looking for isn't here.', TDOMAIN);?></p>
					<div class="center fix"><?php include (THEME_LIB . '/_searchform.php'); ?></div>
				</div>
				</div>
			</div>
	
	<?php endif; // end the loop ?>
	
				</div>
	
				<?php if(!$full_width_page) include(THEME_LIB.'/template_sidebar.php');?>
	
				<div class="clear"></div>
			</div>
		</div>
	</div>
	
	<?php get_footer();?>
Everything seems to be working fine now. Any reason this isn't a good idea?

#15 Danny

Danny

    Is Awesome!

  • Moderators
  • 16952 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 17 May 2012 - 11:59 AM

Hi Nick, If its working that's great. The only reason it's not recommended to edit core files is that most of the time it causes issues and when there is an update to the theme. The changes made will be overwritten. In your case I think you'll be fine, good job and thanks for informing us the issue is now resolved. We appreciate it. **On a sidenote, if you're ever going to be adding that amount of code in a post again, I recommend you use our Paste site. http://paste.pagelines.com/