I was making a beginner’s mistake. I was not defining the global variable post. I publish my complete code for the community. May be useful for something like me.
<?php
add_action( 'genesis_after_entry', 'capitulos_curso' );
function capitulos_curso(){
global $post;
$args = array(
'post_type' => 'curso',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order'
);
$parent = new WP_Query( $args );
?>
<?php if ( $parent->have_posts() ) : ?>
<ul class="parent-page">
<?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
<li><a href="https://wordpress.stackexchange.com/questions/307989/<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
</ul>
<?php endwhile; ?>
<?php endif; wp_reset_postdata();} ?>
<?php
genesis();
Related Posts:
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- Custom Post Type Loop throws 500 error when used in widget
- Move Genesis Single Page/Single Post Title
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- If/Else child list for Custom Post Type single template within loop?
- Pagination not working with custom loop
- Display all posts in a custom post type, grouped by a custom taxonomy
- Have different number of posts on first page
- Display all posts starting with given letter?
- How do you get the count of posts in an archive page?
- group search results by post type?
- wp_pagenavi() with custom wp_query()?
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- How to use a custom post type as front page?
- How to show Y number of custom posts after every X normal posts?
- Automatically create child pages when saving a (parent) page
- Display a list of child posts on parent posts of a custom post type
- Display Authors Comments on Profile Page
- List all posts commented by current user
- 404 on child page when parent page slug is identical to custom post type
- Get Custom post with ID
- Custom Post Type Pagination Not Working On Archive Page
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Display several random posts, but make sure a condition is met
- Category as Class for Custom Post Type
- Create child page within custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Archive page…limiting posts per page
- Adding custom post type to loop
- how do I group content in magazine-style ‘issues’?
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Retrieving 3 latest post from each of 5 different custom post types
- Genesis Child and Custom Post Type
- How to query custom posts using a dynamic category
- WordPress “Loop” with large set of results
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Pagination go to first page if i’m on last post
- Grossly inefficient wordpress loops!
- Posts in Multiple Columns and Rows with one single loop
- Order custom posts by taxonomy?
- Newer/Older posts links display same posts on every page
- Best way to style first post differently?
- How to solve suspected memory issue in custom WordPress loop?
- List events by month
- Display posts of custom type in hierarchical order
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Conditional two level dropdown filter for custom post type
- How do I write this SQL statement for Posts written in last 24 hours?
- Show all custom post type posts sorted by custom taxonomy then by another custom taxonomy
- Alphabetical sorting of custom post type – one letter per page
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- Taxonomy posts on Archive page
- Group search results by post type, but hide post types with no results
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- How to show related posts by category or custom post type?
- Fix custom query pagination without changing site-wide posts-per-page settings
- Custom post type loops with different page templates
- Randomly placed sticky custom posts complemented by blog posts
- How to create posts (not post template) to be displayed on projects page?
- Custom Post Loop in Archive returns same the_permalink
- WP_Query post at custom position
- How to display the rest of categories on Portfolio filterable
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- 404 error PageNavi custom type taxonomy | wordpress
- WooCommerce – Show orders for a specific product ? [closed]
- Get_post_meta() won’t return value
- exclude custom post type by meta key in wp_query
- Query for posts in 2 taxonomies
- Pagination with custom post types results in 404 issues
- Problems excluding a custom post-type from the loop
- Query Custom Post by Category
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- IF statement in a do_shortcode
- Query in a Hierarchical Custom Post Type for Children vs Siblings
- How do you output custom code between posts in the loop?
- Get the title of custom post type in another loop
- How to append element after thumbnail
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- ‘category__and’ for custom taxonomy?
- Edit/Customize the Single Page of a Genesis Sample Child Theme
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Posts navigation in custom post type single.php not working
- Displaying custom posts only if custom meta box’s date is not expired
- Integrating Orbit slider into wordpress through custom post type
- Child page in custom post throws 404 page not found
- Display custom post on home page based on a metabox selection
- Impossible to get Attachments Outside WordPress?
- List posts AND custom post type by category
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- How to list custom post types?
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Remove custom post type slug not working for child pages
- Share parent path between Custom Post Types and Pages?
- Unable to get post content from custom post type loop
- Lists Posts from CPT that match the Title of the Page
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Custom Blog Post Listing in Genesis Sample Child Theme