WordPress.org

Ready to get started?Download WordPress

Forums

Simple Catch
[resolved] Make Featured Slider appear on all pages? (18 posts)

  1. lockerhaxor
    Member
    Posted 1 year ago #

    Hey, I just wanted to see if there was an easy way to get the featured Slider to appear on all pages. Currently it works fine on the home page, but I can't get it to display on posts or other pages at all. Any suggestions? Thanks in advance.

  2. jamesg40
    Member
    Posted 1 year ago #

    What theme are you using and is your featured slider a plugin or is it built into your theme? If its a plugin, can you find a snippet of code in the plugins documentation that shows you how to hard code the featured slider onto your themes template files? Can you provide a link?

  3. lockerhaxor
    Member
    Posted 1 year ago #

    I'm using Simple Catch, the slider is built into the theme itself. I thought I was posting in Simple Catch's support, my bad. But here is the link to the theme itself: http://wordpress.org/extend/themes/simple-catch

    I've been digging around the php, and as far as I can tell it has been setup to only display on the homepage. I'm not terribly familiar with PHP, but I tried changing it to appear on all pages and it won't go through.

    /**
     * Display slider or breadcrumb on header
     *
     * If the page is home or front page, slider is displayed.
     * In other pages, breadcrumb will display if exist bread
     */
    function simplecatch_sliderbreadcrumb() {
    
    	// If the page is home or front page
    	if ( is_home() || is_front_page() ) :
    		// display featured slider
    		if ( function_exists( 'simplecatch_sliders' ) ):
    			simplecatch_sliders();
    		endif;
    	else :
    		// if breadcrumb is not empty, display breadcrumb
    		if ( function_exists( 'bcn_display_list' ) ):
    			echo '<div class="breadcrumb">
    					<ul>';
    						bcn_display_list();
    			 	echo '</ul>
    					<div class="row-end"></div>
    				</div> <!-- .breadcrumb -->';
    		endif; 
    
      	endif;
    } // simplecatch_sliderbreadcrumb

    This seems to be what is preventing me from getting this on any other page. I've honestly never worked with breadcrumbs before, so I have no idea what to do there.

  4. jamesg40
    Member
    Posted 1 year ago #

    Oh, ok.... I have simple catch, give me about an hour and I will provide you the changes you need to make.

  5. lockerhaxor
    Member
    Posted 1 year ago #

    Oh awesome, I appreciate it.

  6. jamesg40
    Member
    Posted 1 year ago #

    Well, I was able to get the slider to display on every page that I created but the problem I found was that it started causing some other problems. Your best bet may be to go to the simple catch forums and ask them. I know it can be done easily by editing the en-queue call on the simplecatch_functions.php file and also copying and pasting the snippet from the header.php into the page.php but like I said, it was causing some minor issues. Sorry I couldn't be more help but your question might be better for the theme developer.

  7. Catch Themes
    Member
    Theme Author

    Posted 1 year ago #

    yes you need to build child theme and then customize function simplecatch_sliderbreadcrumb() and simplecatch_scripts_method() where you have to remove if condition:

    if ( is_home() || is_front_page() )

    If you are still confused with the code and want easy click option then you can upgrade to Simple Catch Pro Theme.

  8. sigurdur81
    Member
    Posted 1 year ago #

    Hey Sakin

    I am trying to make the slider display on all pages, but I am unable to delete the if ( is_home() || is_front_page() ) from the simplecatch_sliderbreadcrumb()

    Could you please be a little more detailed on how to do it?

    Thank you

  9. Catch Themes
    Member
    Theme Author

    Posted 1 year ago #

    @sigurdur81: You just need to remove php condition if ( is_home() || is_front_page() ) :

    But if you are not comfortable editing the theme then you can upgrade to Simple Catch Pro then there is option to add it in all pages. Further, there is option to choose between Featured Image Slider and Featured Post Slider.

  10. sigurdur81
    Member
    Posted 1 year ago #

    When I do the site gives me a server error!

  11. sigurdur81
    Member
    Posted 1 year ago #

    It looks like this after I remove:

    * Display slider or breadcrumb on header
    *
    * If the page is home or front page, slider is displayed.
    * In other pages, breadcrumb will display if exist bread
    */
    function simplecatch_sliderbreadcrumb() {

    // If the page is home or front page

    // display featured slider
    if ( function_exists( 'simplecatch_sliders' ) ):
    simplecatch_sliders();
    endif;
    else :
    // if breadcrumb is not empty, display breadcrumb
    if ( function_exists( 'bcn_display_list' ) ):
    echo '<div class="breadcrumb">

      ';
      bcn_display_list();
      echo '

    <div class="row-end"></div>
    </div> <!-- .breadcrumb -->';
    endif;

    endif;
    } // simplecatch_sliderbreadcrumb

  12. Catch Themes
    Member
    Theme Author

    Posted 1 year ago #

    /**
    * Display slider or breadcrumb on header
    *
    */
    function simplecatch_sliderbreadcrumb() {

    // display featured slider
    if ( function_exists( 'simplecatch_sliders' ) ):
    simplecatch_sliders();
    endif;

    if ( ( !is_home() || !is_front_page() ) && function_exists( 'bcn_display_list' ) ) :
    echo '<div class="breadcrumb">

      ';
      bcn_display_list();
      echo '

    <div class="row-end"></div>
    </div> <!-- .breadcrumb -->';
    endif;
    } // simplecatch_sliderbreadcrumb

  13. sigurdur81
    Member
    Posted 1 year ago #

    That worked but I get double of the circles below.

    Circles= number of slides.

  14. sigurdur81
    Member
    Posted 1 year ago #

    only in the other pages than home page

  15. sigurdur81
    Member
    Posted 1 year ago #

    Here

  16. sigurdur81
    Member
    Posted 1 year ago #

    I fixed it. Thank you for all the help !!

  17. Catch Themes
    Member
    Theme Author

    Posted 1 year ago #

    @sigurdur81: Great you fixed it.

  18. ansonkemp
    Member
    Posted 1 year ago #

    Disregard the former ideas they do not work. Change two lines of code in functions/simplecatch_functions.php essentially just adding "|| is_page()".

    //Enqueue Slider Script only in Front Page
    	if ( is_home() || is_front_page() ) {

    to

    //Enqueue Slider Script only in Front Page
    	if ( is_home() || is_front_page() || is_page() ) {

    and

    // If the page is home or front page
    	if ( is_home() || is_front_page() ) :

    to

    // If the page is home or front page
    	if ( is_home() || is_front_page() || is_page() ) :

    "is_page()" can specify a particular page by id as well if you would like to only show the slider on another specific page. ie.

    is_page(42);
    // When Page 42 (ID) is being displayed.

    is_page('Contact');
    // When the Page with a post_title of "Contact" is being displayed.

    is_page('about-me');
    // When the Page with a post_name (slug) of "about-me" is being displayed.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic