So I'm making a custom theme, I setup the theme Created my pages on wordpress then created my Pages VS code i'll use an example of one page for this:
I created the talent page with the slug: talent
And a page-talent.php:
<?php
get_header();
?>
<div class="talent-arc container">
<?php echo do_shortcode('[visual_portfolio id="8"]'); ?>
</div>
<?php get_footer();?>
But its using my Index.php not the talent page, Ive never come accross this before usually its just create a page create the page-pagenamehere.php files and edit away
My Permalinnks are set to Post name:
My Functions PHP:
<?php
add_theme_support( 'menus' );
add_theme_support( 'post-thumbnails' );
function wpt_excerpt_length( $length ) {
return 70;
}
add_filter( 'excerpt_length', 'wpt_excerpt_length', 999 );
function register_theme_menus() {
register_nav_menus(
array(
'primary-menu' => __( 'Primary_menu' ),
'footer-menu' => __( 'Footer_menu' ),
'extra-menu' => __( 'Extra_menu' )
)
);
}
add_action( 'init', 'register_theme_menus' );
function wpb_image_editor_default_to_gd( $editors ) {
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );
function wpt_theme_styles() {
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/css/bootstrap.css' );
wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/css/jquery-ui.min.css' );
wp_enqueue_style( 'material_css', 'https://fonts.googleapis.com/icon?family=Material+Icons' );
}
add_action( 'wp_enqueue_scripts', 'wpt_theme_styles' );
function theme_js() {
global $wp_scripts;
wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'), '', false );
wp_enqueue_script( 'jquery_ui_js', get_template_directory_uri() . '/js/jquery-ui.min.js', array('jquery'), '', false );
wp_enqueue_script('custom_js', get_template_directory_uri(). '/js/script.js', array('jquery'), '', true);
}
add_action('wp_enqueue_scripts','theme_js');
function new_excerpt_more( $excerpt ) {
return $excerpt. '... <a class="more-link" href="'. get_permalink( get_the_ID() ) . '">' . __('READ MORE') . ' </a>';
}
add_filter( 'get_the_excerpt', 'new_excerpt_more' );
function mytheme_setup() {
add_theme_support('custom-logo');
}
add_action('after_setup_theme', 'mytheme_setup');
?>
CSS Template
/*
Theme Name: KellyJeanCasting Theme
Author:
Author URI:
Description: Theme for kelly
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags:
Text Domain: VSS
*/
Update: Renaming all my files from e.g talent to -> talent-main and adjusting the slugs makes it work, How do I remove that behaviour