• Resolved kdickins

    (@kdickins)


    Hello,

    In my project I’ve had to make alternative front page templates for your theme (that best fits for my purpose). I have edited the slider.php page, the helpers.php, and created the “templates” needed, which resemble the front.php template in its entirety.

    However, when I edit the helpers.php page with this section:

    if ( ! function_exists( 'business_cast_get_featured_slider_content_options' ) ) :
    
    	/**
    	 * Returns the featured slider content options.
    	 *
    	 * @since 1.0.0
    	 *
    	 * @return array Options array.
    	 */
    	function business_cast_get_featured_slider_content_options() {
    		$choices = array(
    			'home-page' => esc_html__( 'Front Page Template', 'business-cast' ),
    			'club-page' => esc_html__( 'Club Page Template', 'business-cast' ),
    			'conference-page' => esc_html__( 'Conference Page Template', 'business-cast' ),
    			'edu-page' => esc_html__( 'Education Page Template', 'business-cast' ),
    			'organization-page' => esc_html__( 'Organization Page Template', 'business-cast' ),
    			'program-page' => esc_html__( 'Program Page Template', 'business-cast' ),
    			'research-page' => esc_html__( 'Research Page Template', 'business-cast' ),
    			'disabled'  => esc_html__( 'Disabled', 'business-cast' ),
    		);
    		return $choices;
    	}
    
    endif;

    and then the slider.php page:

    if ( ! function_exists( 'business_cast_check_slider_status' ) ) :
    
    	/**
    	 * Check status of slider.
    	 *
    	 * @since 1.0.0
    	 *
    	 * @param bool $input Slider status.
    	 */
    	function business_cast_check_slider_status( $input ) {
    
    		$input = false;
    
    		// Slider status.
    		$featured_slider_status = business_cast_get_option( 'featured_slider_status' );
    
    		switch ( $featured_slider_status ) {
    			case 'home-page':
    				if ( is_page_template( 'templates/front.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'club-page':
    				if ( is_page_template( 'templates/club.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'conference-page':
    				if ( is_page_template( 'templates/conference.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'edu-page':
    				if ( is_page_template( 'templates/edu.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'orgnaization-page':
    				if ( is_page_template( 'templates/edu.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'program-page':
    				if ( is_page_template( 'templates/program.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'research-page':
    				if ( is_page_template( 'templates/research.php' ) ) {
    					$input = true;
    				}
    				break;
    			case 'disabled':
    				$input = false;
    				break;
    
    			default:
    				break;
    		}
    
    		return $input;
    
    	}
    
    endif;

    When I add these changes, my club page works, but the front and the rest of the pages no longer work. Is there something I am doing wrong? Editing the wrong page?

    • This topic was modified 6 years ago by kdickins.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author axlethemes

    (@axlethemes)

    Hi @kdickins

    Can you please provide us your site URL?

    Thread Starter kdickins

    (@kdickins)

    Theme Author axlethemes

    (@axlethemes)

    Hi @kdickins

    You are saying slider is working at club page. You have assigned club page to home page but there is no slider on your site.

    Can you provide us temporary wp-admin login to your site?

    Please add us as admin of your site using this email info(at)axlethemes.com

    We will check your issue and try our best to solve it.

    Thread Starter kdickins

    (@kdickins)

    Sorry, I had the front page assigned – I was still working, my apologies.

    I have created a user, and it has sent you an email. Please let me know if you need anything else in the meantime.

    Unfortunately, I was told that it was not the best idea to give you a user in order to figure this problem out. Is there another way that I can give you the information you need?

    • This reply was modified 6 years ago by kdickins.
    Thread Starter kdickins

    (@kdickins)

    @axlethemes
    Having added that code mentioned above to the theme itself (it doesn’t work when I apply it in the child theme for whatever reason), it doesn’t work.

    However, when I do this to the slider.php page:

    if ( ! function_exists( 'business_cast_check_slider_status' ) ) :
    
    	/**
    	 * Check status of slider.
    	 *
    	 * @since 1.0.0
    	 *
    	 * @param bool $input Slider status.
    	 */
    	function business_cast_check_slider_status( $input ) {
    
    		$input = false;
    
    		// Slider status.
    		$featured_slider_status = business_cast_get_option( 'featured_slider_status' );
    
    		switch ( $featured_slider_status ) {
    			case 'home-page':
    				if ( ! is_page_template( 'templates/front.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'club-page':
    				if (  is_page_template( 'templates/club.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'conference-page':
    				if ( ! is_page_template( 'templates/conference.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'edu-page':
    				if ( ! is_page_template( 'templates/edu.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'organization-page':
    				if ( ! is_page_template( 'templates/org.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'program-page':
    				if ( ! is_page_template( 'templates/program.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'research-page':
    				if ( ! is_page_template( 'templates/research.php' ) ) {
    					$input = true;
    				}
    				break;
    
    			case 'disabled':
    				$input = false;
    				break;
    
    			default:
    				break;
    		}
    
    		return $input;
    
    	}
    
    endif;
    

    The helpers.php page remains the same with:

    if ( ! function_exists( 'business_cast_get_featured_slider_content_options' ) ) :
    
    	/**
    	 * Returns the featured slider content options.
    	 *
    	 * @since 1.0.0
    	 *
    	 * @return array Options array.
    	 */
    	function business_cast_get_featured_slider_content_options() {
    		$choices = array(
    			'home-page' => esc_html__( 'Front Page Template', 'business-cast' ),
    			'club-page' => esc_html__( 'Club Page Template', 'business-cast-child' ),
    			'conference-page' => esc_html__( 'Conference Page Template', 'business-cast-child' ),
    			'education-page' => esc_html__( 'Education Page Template', 'business-cast-child' ),
    			'organization-page' => esc_html__( 'Organization Page Template', 'business-cast-child' ),
    			'program-page' => esc_html__( 'Program Page Template', 'business-cast-child' ),
    			'research-page' => esc_html__( 'Research Page Template', 'business-cast-child' ),
    			'disabled'  => esc_html__( 'Disabled', 'business-cast' ),
    		);
    		return $choices;
    	}
    
    endif;

    I get the slider to appear on all pages of the template that I have created, which creates another problem – the slider then appears on ALL pages, whether it’s been called or not.

    Theme Author axlethemes

    (@axlethemes)

    Hi @kdickins

    Please send us zip of child theme you have created to our email id info(at)axlethemes.com

    We will check it and try our best to help you.

    Theme Author axlethemes

    (@axlethemes)

    Hi @kdickins

    You do not need to copy entire slider code on child theme. Remove all the codes you are using to override slider and paste following code on functions.php of your child theme

    function business_cast_check_slider_status( $input ) {
    
    	$input = false;
    
    	// Slider status.
    	$featured_slider_status = business_cast_get_option( 'featured_slider_status' );
    
    	switch ( $featured_slider_status ) {
    		case 'home-page':
    			if ( is_page_template( 'templates/front.php' ) || is_page_template( 'templates/club.php' ) || is_page_template( 'templates/conference.php' ) || is_page_template( 'templates/education.php' ) || is_page_template( 'templates/program.php' ) || is_page_template( 'templates/research.php' ) ) {
    				$input = true;
    			}
    			break;
    
    		case 'disabled':
    			$input = false;
    			break;
    
    		default:
    			break;
    	}
    
    	return $input;
    
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘New Front Page Templates’ is closed to new replies.