Answer the question
In order to leave comments, you need to log in
How to style a page in WordPress?
There is a problem with wp. We are finalizing a third-party site on it, there is, apparently, some kind of plugin that displays services on the site. in it, in this services, there are several pages that need to be styled, but they do not use templates, i.e. you can’t select a template, you can only change blocks in the constructor itself, you can’t display pages from these services in a separate php file. Has anyone experienced this? How can such pages be styled?
links cannot be changed either, url service/
Answer the question
In order to leave comments, you need to log in
You can make your own template for any page (and there is no need to select it in the admin panel)
More details - here
Page Template — If the page has a custom template assigned, WordPress looks for that file and, if found, uses it.
page-{slug}.php - If no custom template has been assigned, WordPress looks for and uses a specialized template that contains the page's slug.
page-{id}.php - If a specialized template that includes the page's slug is not found, WordPress looks for and uses a specialized template named with the page's ID.
page.php - If a specialized template that includes the page's ID is not found, WordPress looks for and uses the theme's default page template.
singular.php - If page.php is not found, WordPress looks for and uses the theme's template used for a single post, irregardless of post type.
index.php - If no specific page templates are assigned or found, WordPress defaults back to using the theme's index file to render pages.
In WordPress, for this, post types and taxonomies are registered using the and functions register_post_type()
, register_taxonomy()
respectively. This registration can be carried out in the theme or in plugins
. To style pages of an arbitrary type, you can create a single-service.php template in the theme root, see more here . You can also use validation if ( get_post_type() === 'service' ) { ... }
anywhere in the project (where global variables are defined)
And to add a template selection, you must list the post types to which it applies when creating it, something like this:
/*
Template Name: Мой шаблон страницы
Template Post Type: post, page, service
*/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question