Home Forums Basel support forum XTEMOS Post Types plugin causing load delay on homepage only

XTEMOS Post Types plugin causing load delay on homepage only

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #125279

    GCMarketing Admin
    Participant

    Hello 🙂
    I am having an issue with my website with XTEMOS Post Types plugin – causing a 44-second delay on my homepage only.

    Not sure why this is occurring – could you kindly assist me to resolve?

    If i visit the homepage directly I have the 44 sec wait
    If i visit the services page – its instant, and then i can click and open the homepage with no issues

    Its quite odd

    Attachments:
    You must be logged in to view attached files.
    #125339

    Artem Temos
    Keymaster

    Hello,

    Try to create a file content-portfolio.php in the child theme with the following code

    <?php
    /**
     * The default template for displaying content
     */
    
    global $basel_portfolio_loop;
    
    $size = 'large';
    
    $classes[] = 'portfolio-entry';
    
    if( !empty($basel_portfolio_loop['columns']) ) 
    
    $columns = ( ! empty( $basel_portfolio_loop['columns'] ) ) ? $basel_portfolio_loop['columns'] : 3;
    
    if( ! is_single() ) {
    	$classes[] = basel_get_grid_el_class(0, $columns, false, 12);
    	$classes[] = 'portfolio-single';
    	$classes[] = 'masonry-item';
    	//$size = 'medium';
    }
    
    $cats = wp_get_post_terms( get_the_ID(), 'project-cat' );
    
    if( ! empty( $cats ) ) {
    	foreach ($cats as $key => $cat) {
    		$classes[] = 'proj-cat-' . $cat->slug;
    	}
    }
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
    	<?php if ( has_post_thumbnail() && ! post_password_required() && ! is_attachment()  && ! is_singular( 'portfolio' ) ) : ?>
    		<header class="entry-header">
    			<figure class="entry-thumbnail">
    					<?php if ( ! is_single() ): ?>
    							<a href="<?php echo esc_url( get_permalink() ); ?>" class="portfolio-thumbnail">
    								<?php the_post_thumbnail( $size ); ?>
    							</a>
    						<?php else: ?>
    							<?php the_post_thumbnail( $size ); ?>
    					<?php endif ?>
    				<a href="<?php echo esc_url( wp_get_attachment_url( get_post_thumbnail_id($post->ID) ) ); ?>" class="portfolio-enlarge"><?php _e('View Large', 'basel'); ?></a>
    			</figure>
    		<?php endif; ?>
    
    		<div class="portfolio-info">
    			
    			<?php if ( is_single() ) : ?>
    				<h1 class="entry-title"><?php the_title(); ?></h1>
    			<?php else : ?>
    				<h1 class="entry-title">
    					<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark"><?php the_title(); ?></a>
    				</h1>
    			<?php endif; // is_single() ?>
    
    			<?php 
    
    				if( ! empty( $cats ) ) {
    					?>
    					<ul class="proj-cats-list font-alt">
    					<?php
    					foreach ($cats as $key => $cat) {
    						$classes[] = 'proj-cat-' . $cat->slug;
    						// get_term_link( $cat, 'project-cat' ); 
    						?>
    							<li><?php echo esc_html($cat->name); ?></li>
    						<?php
    					}
    					?>
    					</ul>
    					<?php
    				}
    
    			 ?>
    		 </div>
    	 </header>
    
    	<?php if ( is_singular( 'portfolio' ) ) : ?>
    		<div class="entry-content">
    			<?php the_content(); ?>
    		</div><!-- .entry-content -->
    	<?php endif; ?>
    
    </article><!-- #post -->

    Regards

    #125368

    GCMarketing Admin
    Participant

    Thank you Artem
    I have added that code in the child theme as a new file called content-portfolio.php

    I tried deactivating the plugin XTEMOS Post Types plugin, after creating the above file but no change.

    Did I miss something?

    #125395

    Artem Temos
    Keymaster

    Yes, it seems to work well now.

    #125397

    GCMarketing Admin
    Participant

    Yes, it is working perfectly now for me too – thank you so much

    #125398

    Artem Temos
    Keymaster

    You are welcome!

Viewing 6 posts - 1 through 6 (of 6 total)