Use the display_post_states
hook:
function custom_display_post_states( $states, $post ) {
if ( 'Services' === $post->post_title ) {
$post_states['custom-content'] = 'Services Page';
}
return $post_states;
}
add_filter( 'display_post_states', 'custom_display_post_states', 10, 2 );
or you can do by ID
if ( 1 === $post->ID) {
$post_states['custom-content'] = 'Services Page';
}
To check if page has template:
function custom_display_post_states( $states, $post ) {
$template = get_page_template_slug( $post->ID );
if ( $template == 'YOUR_TEMPLATE_FILE' ) {
$states['custom-content'] = 'Services Page';
}
return $states;
}
add_filter( 'display_post_states', 'custom_display_post_states', 10, 2 );
Related Posts:
- How to move page template files like page-{slug}.php to a sub-directory?
- Add custom classes to anchor in wp_nav_menu
- Select menu on browser resize
- Returning Variables back into a template
- Displaying wp menus by name without using theme locations
- How to highlight the current page in the nav menu?
- Setting a Default ‘Theme Location’ When Creating a Menu
- Do I really need the div class entry?
- Custom Nav Walker Displaying Values in Sub Menu
- Where is definied the theme location for the main menu in a WordPress template?
- My Admin bar covers my sticky navbar [closed]
- Single Page theme [closed]
- How to make theme elements customizable in wordpress?
- How to add “Template” option in page attributes panel?
- Where am I doing wrong in my theme menu?
- Admin: sub menu doesnt display under apperance when activate my themes
- 3 Level Deep Navigation Menu Not Showing All Levels
- How to add menù section to my WordPress template?
- Thesis -style Navigation
- Why is my container argument not working for wp_nav_menu() [closed]
- Some doubts about WordPress handle the horizontal main menu visualization
- how to create/register menu items that can be added to menus later
- Why nav_menu_css_class doesn’t work with apply_filters?
- Theme: dropdown hover menu not showing up in IE/Edge
- Menu names not getting translated
- Primary Menu Showing All Pages With No Sub-Nav
- Can you create a custom page with content in the center already defined?
- What’s the policy for building a theme that doesn’t support widgets/menus?
- How to make navigation a list without a plugin? [duplicate]
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- What is the point of using the front-page.php template? [closed]
- Dynamic nav menu with icons [closed]
- How to add posts to custom menus?
- How to add custom css file in theme?
- Display Menu Name using wp_nav_menu
- get_template_part vs action hooks in themes
- How to remove search bar from a wordpress theme? [closed]
- Get url of thumbnail from the media uploader
- Template for individual post designs
- Adding items to page template dropdown on Page Edit Screen
- How to use logout function on custom menu link?
- Problem with registering menus – What to do when other solutions aren’t working?
- Pushing updates to your premium theme
- Where can I find a good reviewed collection of Twenty Ten child themes?
- Front End Post Submit Form
- CSS in child theme not overriding the parent theme [closed]
- Page attribute template dropdown not displayed even the syntax is correct
- How to add dynamic inline style?
- Optimal solution to develop a wordpress theme?
- Am I supposed to create a child theme for every theme I use?
- using wordpress without javascript
- Theme Check: Could not find post_class
- Why wp_head() function not loading style.css?
- Override theme programmatically
- Set multiple templates per post
- WP 3.1 upgrade breaks AutoFocus+ theme
- create-guten-block in wordpress theme?
- WordPress navbar with logo in middle [closed]
- wp_post->post_parent object returning 0
- Theme Splash Image within the “Appearance -> Themes” control panel [duplicate]
- Theme Loading Into Dashboard
- Which html elements should be styled in wordpress theme
- Are seven additional image sizes are too many?
- wp_nav_menu and its fallback
- registering a global template wordpress 6.0
- Copying the theme style files and images to duplicate the website but with a difference
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- Theme development – Automatically menu creation
- How to set Post meta-box defaults based on the choices made by user in Customizer?
- Theme Action to hook for one time only function [duplicate]
- Theme development: How to add CSS classes to menu items?
- How do I include a partial from a directory below a wordpress theme directory?
- How to conditionally add a wp_filter
- Is it possible to have a Theme with built-in physical page files?
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- HTTP Error when uploading images over specific dimensions
- Why is the `if else` not working?
- iPad WordPress theme?
- custom Background not showing after upgrade?
- Rolling your own WordPress Themes
- List categories of a post hierarchically?
- PHP Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE), expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 124
- How to display home page last modified date in anywhere of wordpress theme?
- Show all menu levels except top level. How to exclude top level of a menu?
- Is a multipurpose theme an alternative to modifying or creating a theme from scratch?
- WordPress menu walker – Get parent item text inside end_lvl function
- How to achieve this navigation style in wordpress navigation
- How to dowload and edit content of a website
- Next post in category
- After theme change the menus have to be manually linked to the corresponding theme location
- Query custom post type and showing its content
- Horizontal Navigation
- Trouble creating custom sanitization function when uploading video files
- How Does One Create a Global Variable Repository
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- Global Navigation menu in diiferrent wordpress setups
- getting id of page
- How can i display a 4 diferent themplate for the archive page
- Is there any open source WordPress Themes?
- How to show associated fields if checkbox is checked in customize widget screen using wp_customize?