Make table disappear when fields are left blank?

Probably the easiest thing to do would be to fetch the fields above your table, and assign them to variables: $anime_anname = get_post_meta($post->ID, ‘anime_anname’, true); $anime_angenre = get_post_meta($post->ID, ‘anime_angenre’, true); … Then just wrap the table in an if statement that looks like the following: if ( !empty($anime_anname) || !empty($anime_angenre) || … ) { // … Read more

Get options from database using php class

If you have registered your option without setting the fourth parameter $autoload to no your calls to get_option will not trigger any extra database call because all aotoload options are stored in the cache when the site is loaded. To test it add … define( ‘WP_DEBUG’, TRUE ); define( ‘SAVEQUERIES’, TRUE ); … to your … Read more

Customize field names in backend profile edit page through function.php [duplicate]

What you need to look at is hooking into the user_contactmethods filter. Perhaps something along these lines: function test_new_contact(){ $user_contactmethods = array( ‘aim’ => __(‘AIM’), ‘yim’ => __(‘Yahoo IM’), ‘jabber’ => __(‘Jabber / Google Talk’), ‘twitter’ => __( ‘Enter Twitter ID’ ), ); return $user_contactmethods; } add_filter( ‘user_contactmethods’, ‘test_new_contact’ ); Note the “core” user contact … Read more

PHP is filtered out of the WordPress post editor as a security feature. There are some plugins that let you put them in, but I think they’re a pretty bad idea, so I won’t even link to them. If you need PHP on a page, you should be putting that code in a template file … Read more

Adjust the order for returned posts

In order to accomplish what you desire, you’ll have to fetch the posts ahead of time. There is no way to specify in SQL an arbitrary ordering given an ID list. query_posts() creates another main query, throwing out the main query. Since you’re doing this anyway, you can use get_posts() to return a list of … Read more

How to get movies by date

To be able to query on your dates beyond a simple date comparison you should reverse the format of your date field. Dates should always follow the MySQL date format for reliable querying and sorting: YYYY-MM-DD HH:MM:SS To query movies for today you would use a meta query: $args = array( ‘posts_per_page’ => ‘-1’, ‘post_type’ … Read more