If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?

For all intents and purposes, you only need one loop. While s_ha_dum’s comment is correct, odds are since you’re asking this question, you won’t have a need for multiple loops. <? get_header(); ?> <? if(have_posts()): while(have_posts()): the_post(); ?> <!–Your content here, like so–> <div id=”content”> <? the_field(‘body_content’); ?> <? the_field(‘footer_content’); ?> </div> <? endwhile; endif; … Read more

How to query the content of a specific custom post type?

On your custom post type’s single page, you want to treat it similar to your standard post single template. For the most part, you should wrap everything in your single template in one loop like so: <? get_header(); ?> <? if(have_posts()): while(have_posts()): the_post(); ?> <!–Your content goes here–> <? endwhile; endif; ?> <? get_footer(); ?> … Read more

Change the text on the Publish button

If you look into /wp-admin/edit-form-advanced.php, you will find the meta box: add_meta_box(‘submitdiv’, __(‘Publish’), ‘post_submit_meta_box’, $post_type, ‘side’, ‘core’); Note the __(‘Publish’) – the function __() leads to translate() where you get the filter ‘gettext’. There are two ways to handle your problem: 1. Address the string in a single specialized function (be sure to match the … Read more

Make custom post type column sortable

I believe the missing piece to your puzzle is one additional filter to perform the sort and return the sorted data. Try something like the following: function sort_column_by_auction_1357( $vars ){ if ( isset( $vars[“orderby”] ) && “auction” == $vars[“orderby”] ) { $vars = array_merge( $vars, array( “orderby” => “auction” ) ); } return $vars; } … Read more

Fallback if statement based on the number filtered from it

Got some help from a friend and figured out that I needed to move the post_meta stuff into the query with meta_query then just set a fallback from there. <?php $current_date = date(‘Ymd’); $page_object = get_queried_object(); $page_id = get_queried_object_id(); // Match the string “123” to the database value a:1:{i:0;s:3:”123″;} (serialized array) for ACF $page_id = … Read more

Hierarchy between post types

Yes, that is how the hierarchical setting works. Post types are independent entities. You can’t mix and match them just like you can make a “Post” the child of a “Page” or the other way around. So… Is there a way to accomplish this or is this a WordPress limitation? This is intentional behavior. I … Read more