How to add slider on all Pages for Dazzling WordPress theme

as leaving the slider appearing on all posts when they’re open?

  1. Add this code:

<?php dazzling_featured_slider(); ?>

Inside content-page.php and content-single.php and archive.php (optional) file.

  1. Now inside functions.php file replace these lines of code:
if( ( is_home() || is_front_page() ) && of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
}
	
if( ( is_home() || is_front_page() ) && of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '2.2.2', true );
}

With these lines:

if( ( of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
}
	
if( ( of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '2.2.2', true );
}
  1. Now that you are down with that go to extras.php file that you can find in dazzling theme folder - inc.
    And replace this line of code

if ( is_front_page() && of_get_option('dazzling_slider_checkbox') == 1 ) {

With this one:

if ( of_get_option('dazzling_slider_checkbox') == 1 ) {

If you have followed all these steps then slider should now be visible on all posts and pages.

hello, I did everything you said, this pore both this error:
Parse error: syntax error, unexpected ‘{’ in /home/u353131283/public_html/wp-content/themes/dazzling/functions.php on line 157

I changed the code in that file is this:

function dazzling_scripts() {

  wp_enqueue_style( 'dazzling-bootstrap', get_template_directory_uri() . '/inc/css/bootstrap.min.css' );

  wp_enqueue_style( 'dazzling-icons', get_template_directory_uri().'/inc/css/font-awesome.min.css' );
/*CODIGO ANTIGO
  if( ( is_home() || is_front_page() ) && of_get_option('dazzling_slider_checkbox') == 1 ) {
		wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
  }*/
/*CODIGO NOVO*/
if( ( of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
}/*FIM CODIGO NOVO*/
	wp_enqueue_style( 'dazzling-style', get_stylesheet_uri() );

	wp_enqueue_script('dazzling-bootstrapjs', get_template_directory_uri().'/inc/js/bootstrap.min.js', array('jquery') );
/*CODIGO ANTIGO
	if( ( is_home() || is_front_page() ) && of_get_option('dazzling_slider_checkbox') == 1 ) {
		wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '2.2.2', true );
	}*/
/*CODIGO NOVO*/
	if( ( of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '2.2.2', true );
}/* FIM CODIGO NOVO*/

	wp_enqueue_script( 'dazzling-main', get_template_directory_uri() . '/inc/js/main.js', array('jquery') );

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'dazzling_scripts' );

what is wrong?
sorry to give so much trouble!

This code now should work fine. Replace the entire code you provided above with this one and you should be ready to go.

function dazzling_scripts() {

  wp_enqueue_style( 'dazzling-bootstrap', get_template_directory_uri() . '/inc/css/bootstrap.min.css' );

  wp_enqueue_style( 'dazzling-icons', get_template_directory_uri().'/inc/css/font-awesome.min.css' );
/*CODIGO ANTIGO
  if( ( is_home() || is_front_page() ) && of_get_option('dazzling_slider_checkbox') == 1 ) {
		wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
  }*/
/*CODIGO NOVO*/
if( of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_style( 'flexslider-css', get_template_directory_uri().'/inc/css/flexslider.css' );
}/*FIM CODIGO NOVO*/
	wp_enqueue_style( 'dazzling-style', get_stylesheet_uri() );

	wp_enqueue_script('dazzling-bootstrapjs', get_template_directory_uri().'/inc/js/bootstrap.min.js', array('jquery') );
/*CODIGO ANTIGO
	if( ( is_home() || is_front_page() ) && of_get_option('dazzling_slider_checkbox') == 1 ) {
		wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '2.2.2', true );
	}*/
/*CODIGO NOVO*/
	if( of_get_option('dazzling_slider_checkbox') == 1 ) {
	wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/inc/js/flexslider.min.js', array('jquery'), '2.2.2', true );
}/* FIM CODIGO NOVO*/

	wp_enqueue_script( 'dazzling-main', get_template_directory_uri() . '/inc/js/main.js', array('jquery') );

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'dazzling_scripts' );

hello again, I made all the changes you requested, however it worked incorrectly as when accessing a post or page the slider cover data from the post.
download the attached files, please.
if you can help me I will thank you too!

For you see the current Results, visit:

hello

For security reasons you can’t upload .php files on forum. Instead post your website URL and I will look into it. Just make sure that you have made all changes and slider is enabled.

I’ve check everything twice, and that the way you spoke, access the website at the link:
The site is in creation, so this ugly even …
Hug and thank you!

Ok, we should have started with your website URL. :slight_smile:

Now I see that I made slight mistake in my suggestions above. Instead of adding slider code inside content-page.php and content-single.php add it inside page.phpand single.php.

The right place should be right between these two lines:

get_header(); ?>
<div id="content" class="site-content container">

So it would look like this

get_header(); ?>
<?php dazzling_featured_slider(); ?>
<div id="content" class="site-content container">

At first I mixed Dazzling theme with Sparkling theme. Sorry about that.

it worked!
thank you for the help!
Hug and success!

Though I would jump onto this thread as I am trying to achieve the same thing. I’ve tried the above, but as soon as I make the change to the functions.php file I loose access to the site. I end up with a blank page loading.

I’ve made the changes above to the:

page.php
single.php
archive.php
inc/extras.php
functions.php

Also if I make these changes will they be overwritten if there is an update for the theme? If so I guess this would be better done on a child theme?

I did also make a child theme. I added the above listed files to my child theme and modified them. When I modified the functions.php file again the site just went blank.

Any suggestions?