How can I show only if custom field has content [closed]

Again, I’m not familiar with Advanced Custom Fields but you may be able to store the returned value into a variable then test if that variable is empty, like so: <?php $pista1a = types_render_field(“pista-1a”, array(“argument1″=>”value1″,”argument2″=>”value2″,”argument2″=>”value2”)); ?> <ul> <?php if( ! empty( $pista1a ) ) : ?> <li> <?php echo $pista1a; ?> </li> <?php endif; ?> … Read more

How to fetch results from database

There is likely no “cp_job” column like you are thinking. extra data/information about a wordpress post type (it looks like ads is a custom post type here) would be stored as post meta in the database. So you might see something in the wp_post_meta table like: meta_id | post_id | meta_key | meta_value XX | … Read more

Hide button based on PHP result

You can use get_post_status(ID) to check to see if the post is published. You’ll need to pull the post ID (through WP Query/loop/etc) if (get_post_status( $ID ) == “publish”){ #Show Published Button } else { #Show Not Published Button } Get Post Status in the Codex

Exclude Post ID from Array Specified in Custom Field

Your question is pretty vague and you haven’t given any example code, but the following may work for you: <?php global $post; // Arguments $args = array(‘ /* Enter your arguments in here… */ ‘); // The query $the_query = new WP_Query( $args ); // The loop if ( $the_query->have_posts() ) { // Exclude ID … Read more

Sort by multiple options in custom field

I think that if you make your choices list a value=>label list, this should work: https://wordpress.stackexchange.com/a/11454/20807 Instead of your current list, 1 : Ultimate Plus 2 : Ultimate 3 : Professional 4 : Commercial 5 : Business 6 : Free It can also be in the order that you currently have 6 : Free 5 … Read more