SOLUTION
I found it by using the <?php wp_list_pages( $args ); ?> with customizing the args to display only selected children by id.
$args = array (
'title_li' => '',
'child_of' => $post->ID,
'include' => 47
)
<h4> <?php wp_list_pages( $args ); ?> </h4>
and setting the css to target the current and its parent using wordpress default css.
.current-menu-item, .current-page-ancestor {
/* css */
}
Related Posts:
- WordPress Shortcode and Dynamic CSS
- Multiple pages on one with different HTML
- Minify HTML, CSS, JS with PHPWee?
- How to display a value from a radio button in the options menu in wordpress
- Shortcode content output but not in correct place
- An unwanted inline style is added to my body tag
- Show post in slider
- How can I hide Home in my menu in a specific page?
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- how to remove metadata from the posts of my blog?
- Customize position of social icons in upme plugin [closed]
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Wrapping a Sidebar within
- Add Codepen animation as Preloader to WordPress
- Where can I find the inline-css of my theme header?
- Menu Custom Data Attributes
- Website completely messes up when logging out
- Need help removing […] after excerpt
- Link to page with posts of specific type
- Displaying images outside the content
- how to changes mobile menu toggle breakpoint in WordPress
- Background image no longer fits to screen now that project is in php files
- Add other class content with reference class value
- PHP function for horizontal Woocommerce thumbnails and badges
- I can’t go to the page archive-{post_type}.php
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Drop down question
- WP Website is shown in HTML
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- WordPress Slider is not working
- How to display post meta bellow every posts
- how to add functions to my function.php using a child theme?
- Make a full-width wordpress page
- Target a specific container to style on WordPress storefront theme
- How to include different html tags in the header for different pages?
- user update profile for custom code
- Font-Family does not looks like how it should be [closed]
- Where to find the html for WordPress site? [closed]
- Show contact 7 form in popup
- WordPress – Image href for home menu nav not working
- How Can I Center the Logo in the Navigation Menu? [closed]
- featured post as div background
- Trying to customize wordpress drop down categories
- Cant get theme to change footer color through theme customizer
- How to customize posts in WordPress by using HTML and CSS?
- WP_Query not returning results
- Header location [closed]
- How do I link the side images?
- Parse error: syntax error, unexpected ‘}’ in
- Sorting Problem
- How to create a container in php then customise it in CSS
- Custom HTML/CSS Theme into WordPress – SEO considerations
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- How to create different templates for woocommerce single-product.php?
- Editing stylehseet url in head section of WordPress
- How can we upload custom page files?
- add_filter the_content str_replace after shortcode
- How to use SRCSET with get_the_post_thumbnail()?
- How do I make wordpress comment fields required?
- Theme Customizer – Dynamic CSS PHP File
- Using PHP in a Stylesheet (possibly a “.htaccess” problem?)
- WordPress doesn’t include css
- Understanding child theme functions.php
- Javascript code inside “” in core WordPress files .php
- Style every second widget?
- wp nav menu: add attributes to menu items [duplicate]
- Removing unneccessary p-tags (Not every p)
- Plugin CSS not enqueing
- Multiple options not staying selected after saving
- How to design a table based on css values set from admin/dashboard
- How to remove ?wp-mce-4103-20162941
- parts of url disappear when using # inside href=”” [closed]
- Best way to schedule daily change in CSS parameter
- Dot is not added at the end of href
- Add .htm extention to a custom taxonomy
- Custom Background by Page IDs
- Change CSS based on is_user_logged_in
- Is this spyware on my site or a real Java update?
- WordPress plug-in for dynamic download link?
- How to remove the h6 tag for the entry-category Class
- Override user-edit.php to design own profile page
- Replacing WordPress Icons (menu,icons32, etc)?
- Hide A Class and Add Custom HTML Code Using WordPress
- How to use data URL in WordPress?
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- How to display post_content from database in different on template page?
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- Highlight Single Page Ancestor
- Add Alt attribute to image served with php
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in C:\xampp\htdocs\AttendanceSystem\resources\php\method.php on line 250 [closed]
- Is there a better way to output HTML as a shortcode?
- Remove post image caption from post_excerpt();