taro
September 8, 2017, 10:57am
1
After the update the following code stopped working correctly. It’s shows 5 images and no slider.
header.php
<?php benelux_featured_slider(); ?>
functions.php
function benelux_featured_slider() {
echo '';
echo '<ul>';
$count = of_get_option( 'sparkling_slide_number' );
$slidecat =of_get_option( 'sparkling_slide_categories' );
$query = new WP_Query( array( 'cat' =>'230','posts_per_page' =>$count ) );
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
echo '<li><a href="'. get_permalink() .'">';
if ( (function_exists( 'has_post_thumbnail' )) && ( has_post_thumbnail() ) ) :
echo get_the_post_thumbnail();
endif;
echo '';
if ( get_the_title() != '' ) echo ''. get_the_title().'';
if ( get_the_excerpt() != '' ) echo '' . get_the_excerpt() .'';
echo '</div>';
echo '</a></li>';
endwhile;
endif;
echo '</ul>';
echo ' </div>';
}
movin
September 8, 2017, 11:30am
2
Hi @taro ,
Sorry to hear of the problem you are having.
Your code is not shared correctly in the topic so could you please share it again on https://pastebin.com/
Best Regards,
Movin
taro
September 8, 2017, 11:35am
3
movin
September 9, 2017, 4:07pm
4
Your shared slider code is old code so please use the following updated slider code.
taro
September 11, 2017, 3:20pm
5
@Movin
Changing the function from function sparkling_featured_slider() { to function benelux_featured_slider() { and ‘cat’ => $slidecat, to ‘cat’ => ‘230’, did not work…
The page is loading correct but not showing the slider.
movin
September 12, 2017, 9:58am
6
You have to also change the function call in the header.php file from benelux_featured_slider to sparkling_featured_slider.
If you don’t want to change function call then please change the shared function name from sparkling_featured_slider to benelux_featured_slider
taro
September 12, 2017, 10:00am
7
that code is active in the header <?php benelux_featured_slider(); ?>
changing it both back to sparkling_featured_slider is not doing it. So it has to do with the cat
$query = new WP_Query( array(
'cat' => '230',
'posts_per_page' => $count,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'
),
),
) );
movin
September 12, 2017, 10:08am
8
Please share again the whole modified code that you are using.
taro
September 12, 2017, 10:11am
9
functions.php code
header code
<?php benelux_featured_slider(); ?>
movin
September 12, 2017, 10:21am
10
The shared code seems fine so i visited your shared site and found some required files are not loading in your site due to its incorrect path as shown in the attached screenshot.
Your child theme is trying to load the file on URL https://weiszgroup.com/wp-content/themes/sparkling/inc/css/flexslider.css which is wrong and in the new theme version the file is located in the path https://weiszgroup.com/wp-content/themes/sparkling/assets/css/flexslider.css
You have to change your child theme code to make it work with latest version of theme or just use older version of Sparkling theme that was working fine for you.
taro
September 12, 2017, 10:24am
11
Thanks! I will try and update my files to the new child theme.
movin
September 13, 2017, 8:50am
12
You are most welcome here
taro
September 14, 2017, 7:58am
13
@Movin
Thanks for the warm welcome !
I changed all the errors and updated some code but the slider is not showing.
Current header page
Current news page
Current function code
movin
September 14, 2017, 10:26am
14
On your site you are not loading the flexslider js file /assets/js/vendor/flexslider.min.js from your child theme.
Could you please share me your whole child theme so that i can resolve the issue in it?
movin
September 15, 2017, 9:55am
16
Please try using attached modified functions.php file in your child theme.
movin
September 16, 2017, 1:35pm
18
Would you mind if i log in to your site and do some troubleshooting? If this is ok then could you please share me your site log in details privately by checking the option “Set as private reply” when replying to this topic?
Hi, The slider of my Sparkling theme suddenly stopped working, it was fine few days before but now has completely stopped working.
My site is https://roamonurown.com
movin
September 19, 2017, 9:11am
20
@roamonurown The slider is working fine on your shared site as shown in the attached screenshot.
Please test it clearing your browser cache or using different browser.