Display a list of custom post types titles

I´m displaying a list of custom post types using this code:

    <!-- List post types -->
    <?php $args = array(
        'post_type'=>'artworks_post',
        'title_li'=> __('')
    );
    wp_list_pages( $args ); 
    ?> 

The problem is that I can´t control that list, is there other way to display a list of custom post type titles where I can control how it will make the markup?

Related posts

Leave a Reply

1 comment

  1. Use a regular ol’ WP_Query()

    // The Query
    $the_query = new WP_Query( 'post_type=artworks_post' );
    
    // The Loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
        echo '<a rel="' .the_permalink(). '" href="' .the_permalink(). ' ">'. the_title() .'</a>';
    endwhile;
    
    // Reset Post Data
    wp_reset_postdata();