• breez

    (@kandrews544)


    I have a sydney-child theme, but after the upgrade to sydney 1.80 a custom application I’d built using the blog archive depending on layout classic-alt isn’t displaying the content the way it was because the default layout changed to layout2.

    I’m looking for a way to get back to the previous layout or direction on the best approach to changing the current layout to fit my needs.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @kandrews544,

    Thank you for contacting us. I am happy to help with your queries.

    Firstly, try adding this CSS code to Appearance > Customize > Additional CSS from dashboard.

    
    .content-area.layout2 .entry-meta {
      text-align: center;
      display: block;  
    }
    
    .content-area.layout2 .entry-header {
      text-align: center;
    }
    

    Then do these steps:

    1. Install and activate the TC Custom JavaScript plugin
    2. Go To Appearance > Custom JavaScript
    3. Paste the following code into the provided box

    
    ;(function($) {
    
      'use strict'
    
      if( $('.content-area.layout2').length ){
    
        $('.content-area.layout2 .hentry').each(function(){
          
          var postHeader = $(this).find('.entry-header');
          var postDate = $(this).find('.entry-meta').find('.posted-on');
          
          if( postDate.length ) {
            postDate.remove().clone().appendTo( postHeader );
          }    
          
        });
    
      } 
    
    })(jQuery);
    

    4. Update

    Hope that hlps.

    Regards,
    Kharis

    Thread Starter breez

    (@kandrews544)

    Kharis,
    Thank you for your quick reply and detailed help. I followed your instructions, but unfortunately, it didn’t change the layout back to what it was so my app is no longer working. I left the page with your fixes so you could see what it’s doing. I’m getting a new error now:

    Failed to load resource: the server responded with a status of 500 ()

    When the layout is “layout2” (previously classic-alt), what should be displayed is a dropdown list of years, and underneath a list of show results. When the user selects a year, the list of show results changes to display the show result list that matches that year. Here’s the code from the page that is a modified copy in the sydney-child theme named archive-horse_show_results.php:

    <?php
    /**
     * The template for displaying archive pages.
     *
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package Sydney
     */
    
    get_header(); 
    
    $layout = sydney_blog_layout();
    
    ?>
    
    	<?php do_action('sydney_before_content'); ?>
    
    	<div id="primary" class="content-area col-md-9 <?php echo esc_attr( $layout ); ?>">
    
    		<?php sydney_yoast_seo_breadcrumbs(); ?>
    
    		<main id="main" class="post-wrap" role="main">
    
    		<?php if ( have_posts() ) : ?>
    
    			<header class="page-header">
    				<?php /**
    					the_archive_title( '<h3 class="archive-title">', '</h3>' );
    				 */?>
    			</header><!-- .page-header -->
    
    				<?php
    				if ( $layout != 'layout2' ) {
    						get_template_part( 'content',  get_post_format() );
    					} else {
    						
    						get_template_part( 'content', 'horse_show_results' );
    				}
     
    				?>
    
    		<?php endif; ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    	<?php do_action('sydney_after_content'); ?>
    
    <?php 
    	if ( ( $layout == 'classic-alt' ) || ( $layout == 'classic' ) ) :
    	get_sidebar();
    	endif;
    ?>
    <?php get_footer(); ?>

    Thank you for taking another look at this.

    Thread Starter breez

    (@kandrews544)

    Amendment to what I posted previously:
    I’m no longer getting the 500 error, that was my mistake.

    I found another page based off the blog archive is also affected: https://www.palominohba.com/pipstallions/

    Thread Starter breez

    (@kandrews544)

    Digging a bit deeper I found a new error, an unexpected end of file on: content-horse_show_results.php

    <?php
    /**
     * @package Sydney
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>
    
    	<header class="entry-header">
    
    	
    
    <?php
    echo "Show results issues being worked on.";
    ?>
    			<?php /** display a dropdown list of available years	*/ ?>
    			<form action="" method="post">
    			    <select id="selectshowyear" name="selectshowyear"> 
    			        <?php
    			                
    			        // Iterating through the horse show results taxonomy array
    
    			            $term_id =78; 
    							$taxonomy_name = 'horse_show_results_category'; 
    							$term_children = get_term_children( $term_id, $taxonomy_name ); 
    							foreach ( $term_children as $child ) { 
    							    $term = get_term_by( 'id', $child, $taxonomy_name); 
    			        	?>
    			        	<option value="<?php echo ($term->name); ?>"><?php echo $term->name; ?></option>
    			        
    			    </select>
    		    		<input type="submit" name="submit" value="Select the Show Year" />
    	    	</form>
    <?php
    echo "Show year selection.";
    ?>		
    			<?php
    			if(isset($_POST['submit'])){
    				$showyear = $_POST['selectshowyear'];  // Storing Selected Value In Variable
    
    			}
    			else {
    				$showyear = date("Y");
    			} 
    			?>
    			<br />
    <?php
    echo "Show year post.";
    ?>
    <h1><?php echo $showyear ;?> Horse Show Results</h1>
    
    	</header><!-- .entry-header -->
    
    	<div class="entry-content">
    		<?php the_content(); ?>
    	
    			<?php 
    						// query for the horse show results posts for the shosen year
    						$args = array(
    							'post_type'			=> 'horse_show_results',
    							'post-status'		=> 'publish',
    							'posts_per_page' 	=> -1,
    							'orderby'			=> 'date',
    							'order'				=>	'DESC',
    							'tax_query'			=> array(
    														array(
    															'taxonomy'	=> 'horse_show_results_category',
    															'field'		=>	'slug',
    															'terms'		=>	array( $showyear ),
    														),
    													),
    							);
    
    						$the_query = new WP_Query( $args );
    			 ?>	
    
    				
    			<?php /**This should get the horse show results post types and sort them in ascending order */?>
    
    		<div >
    			<?php if( $the_query->have_posts() ): ?>
    
    					<?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
    
    						<div >
    						<h3> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - 
    							<?php the_field('city');?>, &nbsp; <?php the_field('state'); ?></h3>
    							<p>
    								Horses: &nbsp; <?php echo the_field('horses'); ?> <br />
    								Entries: &nbsp; <?php the_field('entries'); ?> <br />
    								Posted on: &nbsp;
    								 <?php {
    								 	$date = get_field('date', false, false); 
    								 	$date = new DateTime($date); 
    									 }
    								 ?>
    								 <?php echo $date->format('m/d/y'); ?> 
    							</p>
    						<hr>
    						</div> 
    					<?php endwhile; ?>
    				<?php else : ?>
    					<p> <?php esc_html_e( 'Sorry, there are no posts matching your criteria.'); ?> </p>
    			<?php endif; ?>
    			
    		</div>
    	
    </div>
    
    <?php wp_reset_query();	 // Restore global post data stomped by the_post(). ?>
    	
    	<footer class="entry-footer">
    		<?php sydney_entry_footer(); ?>
    	</footer><!-- .entry-footer -->
    </article><!-- #post-## -->

    Hi @kandrews544.

    Please confirm whether you got the given custom jQuery code solution directly from the thread — not from email.

    The code seen on email was converted to secured-format due to email protection and not eligible to use on your site.

    Going further, direct editing on the theme’s files is not recommended. If you’re unsure about what you’re doing, please remove your changes as you can reinstall the theme by doing these steps:

    1. Download the zip package of the theme from this link
    2. Upload it to your site’s folder under public_html/wp-content/themes
    3. Remove the existing sydney folder
    4. Extract the Sydney theme zip package

    Regards,
    Kharis

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘layout2 replaced classic-alt layout with 1.80’ is closed to new replies.