When you create a template page, it does not create a WordPress URL for it. So for example, if you create a PHP file called contact-content.php
it doesn’t generate example.com/contact/
.
If you don’t want to manually create a page and assign a Page Template to it (which by the way would normally be named something like tpl-content.php
– the PHP comments are what designate it to be a Page Template you can select in the editor), you can add code in your child theme so that upon activation, it automatically creates a Page with whatever slug you want. If it’s just your site, you’ll know your permalink structure so you can be sure the URL will be what you wish. If it’s something you’re applying to many sites with different settings, you may still face the issue of different styles of permalinks – i.e. example.com?p=123
versus example.com/contact/
.
Related Posts:
- Warning: printf(): Too few arguments in helpers.php file
- why is translation not working on theme?
- Is having multiple theme customizers for different pages possible?
- How to export/import theme customizer settings?
- reason of splitting theme files to multiple files
- How to get the registered sidebar’s name by its id?
- is there a simple way to list every templates / php files used to generate a specific page?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- One button to change all settings in theme customizer?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Design view breaking on Pages
- Understanding WordPress child theme custom JS loading
- Use different javascript files for each page on website
- How to get custom image size for image uploaded in Customizer
- Passing array in add_option()
- Widgets not showing in my custom theme
- Want to create Child theme, but already edited Parent theme css files and some php files
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Changing the template hierarchy
- Can’t load WP function into external function
- Set WordPress Default Template
- Customizer: Output default value in Customizer CSS
- WordPress does not load page.php, return 404.php
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- Customizer: active_callback and sanitize_callback incompatibility?
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I link a button I created in theme customizer to a function?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- What does this mean in wordpress? Easy question
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Separation of presentation and code – WordPress
- WordPress Customizer Default Image
- Why in my theme I can’t see all the statics content under the posts?
- get_template_directory adding FTP root folders in urls
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Save Custom CSS file in the upload folder dynamically?
- How to specify the path for require_once in a child theme?
- home.php show blog posts as grid view
- How to Update an old theme for the latest wordpress version
- get_comments_number() returns 0
- Problems clearing cache
- Removing “Powered by” footer using child theme PHP [closed]
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why in this WordPress theme I can’t see the Main Menu?
- How can I assign separate stylesheets to different pages?
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- Commas in Tag Cloud
- Trying to change featured image from 180×180 to full width on home page
- WordPress redirects page query parameter in URL
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Not able to remove caption shortcode from the content
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- remove_action from parent theme using child theme functions.php
- File from parent theme imported to child theme doesn’t work – any ideas?
- Unable to retrieve get_author_posts_url
- Display post date also if the date it’s the same for each post
- How to Change Site Elements based on referring URL
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Add the shortcodes from the enfold theme to the other theme
- Menu to the right of screen on desktop using Bootstrap 4
- Add Text Area To Child Theme’s Home Page
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- Local WordPress from Git repo, where to set document root?
- Use Custiomizer to setup meta theme color tag
- Rotating Header Images
- Create a custom theme-specific page, invisible in the admin-panel?
- WP Knowledge Base Theme bug – Subcategories and Articles, Need to change WP_Query
- Image not displayed
- Predefine Magazine Style Layouts
- How to store the_post_thumbnail() value in a variable
- Font Awesome Icons as squares [closed]
- Switching between custom templates in a post type of the admin menu
- Adding code to child theme functions.php to override parent theme behaviour doesn’t work
- How to remove a file included in parent theme with locate_template() via child theme?
- Custom category code not showing all posts
- How to use my style.css file outside of wordpress subdomain?
- WordPress add post format support not working
- Skt full width basic slideshow problem
- get_template_part() not firing within a switch statement when template has new WP_Query
- How to call multiple functions from multiple files into a WordPress page template [closed]
- Need oop for wordpress theme? [duplicate]
- What is the best way to define constant options for a theme?
- Help Fallback (thumbnail)
- Show different website layout if no sidebar added
- How do you remove header sitewide from mobile only?
- Why front-page.php doesn’t show content of file instead shows loop
- How to change PHP variables with AJAX request in WordPress
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- Trying to get pagination working on WP_Query() post grid
- Child theme menu not appearing in Twenty Seventeen
- Click to expand menu
- calling a function from a class in your template
- How to migrate the menu from the site on my own theme in WordPress?
- Showing custom field contents without listing description
- If I define a variable in header.php, how do I make it available to templates?