slider on top of the website - configure slider for Sparkling theme

I hope you can help me. We have set up a blog page in the theme Dazzling. If we place a blog on our website we write text and we add a picture to it. Now, if we place a picture with the blog item the picture in the slider changes. But we want to have the same picture on the slider the whole time. Is that possible and if yes, how can I arrange that?

@kimminten

Use a specific category for your posts that would be then used just for slider.

For example all your posts are categorized under “News” and that’s fine but you can introduce another category. For example you could use “Featured” as category name and now you could categorize all posts under “News” category and one that you want to use on slider you can categorize under “News” and “Featured” categories. This is just a general example and you can come up with different category names but use only specific category for posts that will appear on slider.

Dear Aigars,

Thank you for your answer. But I forgot something to mentioned. We want the same slider for the whole time. But the text in the slider has to be from the latest posted blog. Is that also possible or does it works the same way?

And how does “the system” knows that I want to show the picture from the category “News” and not from the category “Featured” ( for example )

Thank you again for your answer.

@kimminten

  1. You can use the same image for all slides but for that you need to modify theme code. Go to file called extras.php that you can find in Dazzling folder >> inc.

Now find and remove these lines of code:

if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) :
  echo get_the_post_thumbnail();
endif;	

And replace it with URL to your image that you want to use. Here is an example using image from our theme demo:

echo '<img src="http://cdn4.colorlib.com/dazzling/wp-content/uploads/sites/6/2013/01/homev_updated1_02.jpg">';

Save changes and you are ready to go.

These changes can be done via Child Theme as well if you are familiar with this concept. If so just take the entire dazzling_featured_slider function from extras.php file that starts at line 268 and ends at 309 and copy/paste to Child Theme functions.php file and make above mentioned changes there. That way you will make theme update safe but for that you need a Child Theme. You can read more about it here.

  1. WordPress takes “Featured Images” from your posts and uses those as images for slider. You can read more about featured images on official WordPress documentation.

Let me know if this helps.

Dear Aigars,

Thank you, I’m going to try the solution as you mentioned bij “1”
Can you give me some more information if it is possible to keep the text from the latest blog?
See attachment for more information.

Thank you.

Kind regards.

@kimminten

It is possible only with one category, so you will have to use the same category for all posts only then it will be displayed in slider. Setup you need to setup to display only one entry. That way you will get most recent post displayed in slider.

If you don’t want to use the same category for all posts, just use the most popular category with most posts on it and that you update most often.