Quantcast
Channel: Catch Themes » All Posts
Viewing all articles
Browse latest Browse all 4335

Reply To: Slider – remove links

$
0
0

Hi Mahesh,

I’m afraid I can’t get this to work, perhaps I’ve inserted it incorrectly into the child theme functions.php? Here’s the file:

<?php
/**
 * Child Theme functions and definitions
 *
 */
add_action( 'wp_enqueue_scripts', 'catchkathmandu_child_enqueue_styles' );
function catchkathmandu_child_enqueue_styles() {
    wp_enqueue_style( 'catchkathmandu-parent-style', get_template_directory_uri() . '/style.css' );
}
function catchkathmandu_post_sliders() {
	//delete_transient( 'catchkathmandu_post_sliders' );

	global $post;
	global $catchkathmandu_options_settings;
   	$options = $catchkathmandu_options_settings;

	if( ( !$catchkathmandu_post_sliders = get_transient( 'catchkathmandu_post_sliders' ) ) && !empty( $options[ 'featured_slider' ] ) ) {
		echo '<!-- refreshing cache -->';

		$catchkathmandu_post_sliders = '
		<div id="main-slider" class="container">
        	<section class="featured-slider">';
				$get_featured_posts = new WP_Query( array(
					'posts_per_page' => $options[ 'slider_qty' ],
					'post__in'		 => $options[ 'featured_slider' ],
					'orderby' 		 => 'post__in',
					'ignore_sticky_posts' => 1 // ignore sticky posts
				));
				$i=0; while ( $get_featured_posts->have_posts()) : $get_featured_posts->the_post(); $i++;
					$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
					$excerpt = get_the_excerpt();
					if ( $i == 1 ) { $classes = 'post postid-'.$post->ID.' hentry slides displayblock'; } else { $classes = 'post postid-'.$post->ID.' hentry slides displaynone'; }
					$catchkathmandu_post_sliders .= '
					<article class="'.$classes.'">
						<figure class="slider-image">
							'. get_the_post_thumbnail( $post->ID, 'slider', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class'	=> 'pngfix' ) ).'
						</figure>
						<div class="entry-container">
							<header class="entry-header">
								<h1 class="entry-title">
									<a title="Permalink to '.the_title('','',false).'" href="' . get_permalink() . '">'.the_title( '<span>','</span>', false ).'</a>
								</h1>
								<div class="assistive-text">'.catchkathmandu_page_post_meta().'</div>
							</header>';
							if( $excerpt !='') {
								$catchkathmandu_post_sliders .= '<div class="entry-content">'. $excerpt.'</div>';
							}
							$catchkathmandu_post_sliders .= '
						</div>
					</article><!-- .slides -->';
				endwhile; wp_reset_query();
				$catchkathmandu_post_sliders .= '
			</section>
        	<div id="slider-nav">
        		<a class="slide-previous"><</a>
        		<a class="slide-next">></a>
        	</div>
        	<div id="controllers"></div>
  		</div><!-- #main-slider -->';

	set_transient( 'catchkathmandu_post_sliders', $catchkathmandu_post_sliders, 86940 );
	}
	echo $catchkathmandu_post_sliders;
} // catchkathmandu_post_sliders

/**
 * Loading Parent theme stylesheet
 *
 */

Kind regards,

Roland


Viewing all articles
Browse latest Browse all 4335

Trending Articles