New Front Page Templates
-
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?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘New Front Page Templates’ is closed to new replies.