Nexgen Slideshow in header
-
I was wondering if anyone knows the code to use in a header file to display a slideshow like it is on this website : https://www.leadingmcw.com
Thanks
-
This is my header.php file
<?php /** * The Header for our theme. * * Displays all of the <head> section and everything up till <div id="content"> * * @package Listify */ ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php wp_title( '|', true, 'right' ); ?></title> <link rel="profile" href="https://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page" class="hfeed site"> <header id="masthead" class="site-header" role="banner"> <div class="primary-header"> <div class="container"> <div class="primary-header-inner"> <div class="site-branding"> <?php $header_image = get_header_image(); ?> <?php if ( ! empty( $header_image ) ) : ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home" class="custom-header"><img src="<?php echo esc_url( $header_image ); ?>" alt=""></a> <?php endif; ?> <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> </div> <div class="primary nav-menu"> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'nav-menu-container' ) ); ?> </div> </div> <div id="search-header" class="search-overlay"> <div class="container"> <?php locate_template( array( 'searchform-header.php', 'searchform.php' ), true, false ); ?> <a href="#search-header" data-toggle="#search-header" class="ion-close search-overlay-toggle"></a> </div> </div> </div> </div> <nav id="site-navigation" class="main-navigation" role="navigation"> <div class="container"> <a href="#" class="navigation-bar-toggle"> <i class="ion-navicon-round"></i> <?php echo listify_get_theme_menu_name( 'primary' ); ?> </a> <div class="navigation-bar-wrapper"> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'primary nav-menu', 'menu_class' => 'primary nav-menu' ) ); wp_nav_menu( array( 'theme_location' => 'secondary', 'container_class' => 'secondary nav-menu', 'menu_class' => 'secondary nav-menu' ) ); ?> </div> <?php if ( listify_theme_mod( 'nav-search' ) ) : ?> <a href="#search-navigation" data-toggle="#search-navigation" class="ion-search search-overlay-toggle"></a> <div id="search-navigation" class="search-overlay"> <?php locate_template( array( 'searchform-header.php', 'searchform.php' ), true, false ); ?> <a href="#search-navigation" data-toggle="#search-navigation" class="ion-close search-overlay-toggle"></a> </div> <?php endif; ?> </div> </nav><!-- #site-navigation --> </header><!-- #masthead --> <?php do_action( 'listify_content_before' ); ?> <div id="content" class="site-content">
Where to Insert this code
<?php if (function_exists('nggSlideshowWidget')) { echo " "; nggSlideshowWidget(1,1500,1000); } ?>
Any help would be appreciated
@amithak50 – I would suggest something a bit simpler for the code since you are modifying the theme …
<?php echo do_shortcode( '[slideshow ids=1]' ); ?>
That continues to use the NextGEN Legacy version of shortcodes (although I would recommend a more current version as noted here: https://nextgen-gallery.com/nextgen-gallery-shortcodes/) … also to note, using current shortcodes will provide for additional parameters to better control the display.
As to where specifically to add the code, that will still be at your discretion to ensure it fits where you want it to be.
– Cais.
hi,
Thanks for reply
I added this code `<?php echo do_shortcode( ‘[slideshow ids=1]’ ); ?>
below
<?php $header_image = get_header_image(); ?>
`
but has no effect ,I think it does not support itAmit
@amithak50 – Is there nothing at all or are you seeing any sort of error message indicating it is not working?
The code line is valid but it may still be something in your implementation and/or theme.
– Cais.
Hi,
Thanks for reply
i am getting this error “We cannot display this gallery” ,you can see on this website
cravesushi.com
Thanks
Amit@amithak50 – Let’s use the current NextGEN Gallery shortcodes instead … give this a try in the same place:
<?php echo do_shortcode( '[ngg_images gallery_ids=1 display_type=photocrati-nextgen_basic_slideshow]' ); ?>
Thanks!
– Cais.
- The topic ‘Nexgen Slideshow in header’ is closed to new replies.