Home › Support › Business Point › Slider not following order set in slides
Tagged: Slider
- This topic has 5 replies, 4 voices, and was last updated 5 years ago by
Anonymous.
-
AuthorPosts
-
May 8, 2019 at 8:08 am #11830
Anonymous
InactiveHi,
Setting order of slides does not work correctly. They appear to be somewhat random, not in set order nor in post id order.
Thanks in advance for fixing this 😉
Adam
May 20, 2019 at 6:44 am #11931nirav
KeymasterHello Amikron,
The issue you are facing is already solved in our business point 2.1.2 version.
Can you please make sure you have installed version theme.
The issue will be solved you update the theme.Please feel free to let us know if you have any further queries.
Thank you.
May 21, 2019 at 6:13 am #11949Anonymous
InactiveHi again,
I’m afraid I had the latest version allready installed, when I submitted this post. I have fixed it myself by adding menu_order as ‘id’ to $output in helpers.php and then sorting over it, but I wouldn’t like to change this code after every update of the theme ;-).
Best regards,
AdamMay 6, 2020 at 9:53 am #15726Anonymous
InactiveSame problem here.
May 7, 2020 at 6:38 am #15742Anonymous
InactiveI’ve fixed this on my own. In include/helpers.php in function business_point_get_slider_details you have to add order to output array and then sort the array over it.
I’m posting whole fragment, so you can easily find changes:
$posts = get_posts( $query_args );
if ( ! empty( $posts ) ) {
$p_count = 1;
foreach ( $posts as $post ) {
if ( has_post_thumbnail( $post->ID ) ) {
$image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ );
$output[ $p_count ][‘image_url’] = $image_array[0];
$output[ $p_count ][‘title’] = $post->post_title;
$output[ $p_count ][‘url’] = get_permalink( $post->ID );
$output[ $p_count ][‘excerpt’] = business_point_get_the_excerpt( absint($slider_excerpt_length), $post );
$output[ $p_count ][‘id’] = $post->menu_order; //store order in output array$p_count++;
}
}
// sort over it
foreach ($output as $key => $row)
{
$slider_pages[$key] = $row[‘id’];
}
array_multisort($slider_pages, SORT_ASC, $output);
}return $output;
October 9, 2020 at 10:49 am #17153Anonymous
InactiveI think I need to change my website theme with Prodesign because it is have too much extra features that’s may help me to get better design. You can see my pet dog website here dogsfreedom.com
-
AuthorPosts
- You must be logged in to reply to this topic.