Standard Page Child of CPT Not Found (404)
Standard Page Child of CPT Not Found (404)
Standard Page Child of CPT Not Found (404)
How to use POST method using custom wordpress button?
This took as surprisingly long time but I managed to figure it out: fieldset.bbp-form { display: none; } .page-id-170 * fieldset.bbp-form { display: block !important; } I know this hides all and only shows on page id 170, and this is the opposite of what I asked but it suits my needs. An answer more … Read more
More than one parent page can be used. Only the actual home page should be set using the setting described above.
You can get all ancestors with get_post_ancestors. The root ancestor is the last element of the returned array. Here is the function that checks a target page id against the root ancestor of current page: function check_page_parent( $target_page_id ) { $ancestors = get_post_ancestors( get_the_ID() ); if ( $ancestors ) { $top_most_parent_index = count( $ancestors ) … Read more
You can use get_page_by_path() to get a Page’s WP_Post object using its slug (ie, its path), and then use that object to then get the array of child page IDs using get_children(). // First we’ll create the list of posts (pages) to exclude. $exclude = array(); $parent_page_obj = get_page_by_path( ‘abc’ ); if ( ! empty( … Read more
If think you were using the wrong filter, please try using ‘single_template’. I assume you have created a plugin to create your custom post type. In the plugin folder you have a “templates” folder where you put the single page template called “palaver_single.php”. function palaver_single_mapping($single) { global $post; if ( $post->post_type == ‘palaver’ ) { … Read more
If the php file is gets included or required from functions.php file in parent theme all codes are added to runtime they are not replaced if you create files in similar directory structure. So, What can be replaced? Only files called via get_template_part() can be replaced this way. This is also true for any file … Read more
As per the get_pages() documentation: ‘child_of’ (int) Page ID to return child and grandchild pages of. ‘parent’ (int) Page ID to return direct children of. Default -1, or no restriction. So to get immediate children of a specific page, you would use the parent arg and not child_of. $pages = get_pages( array( ‘parent’ => $pageID, … Read more
this is how i solved my problem: <?php $pageid = $post->ID; $pageslug = $post->post_name; $pos = $post->post_parent; $posname = get_post_field( ‘post_name’, $pos );; $arg1 = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ‘pagename’ => $posname.”https://wordpress.stackexchange.com/”.$pageslug.’/infraestructura’, ); $child = new WP_Query( $arg1 ); ?> <div class=”wrapp”> <?php if ($child->have_posts()) :?> <?php while ($child->have_posts()) : $child->the_post(); ?> … Read more