Query & Order posts by custom fields

You need to use the meta_query parameter of the WP_Class when running a query. Something like this should point you in the right direction. $data = date(“Y-m-d”); $args = array( ‘post_type’ => ‘jogos’, ‘meta_query’ => array( array( ‘key’ => ‘data_de_lancamento’, ‘value’ => $data, ‘compare’ => ‘<=’ ) ), ‘meta_key’ => ‘views’, ‘orderby’ => ‘meta_value’, ‘order’ … Read more

WordPress – Display array data of a child

This will show the checkboxes that have been ticked (much simpler!!): <?php $categories = get_field(‘categories’); $elements = array(); foreach($categories as $category) { //do something $elements[] = ‘<a href=”https://wordpress.stackexchange.com/tags/design/” . strtolower($category) . ‘” title=”‘ . $category . ‘”>’ . $category .'</a>’; } echo implode(‘,’, $elements); ?>

Create own WordPress shortcode gallery

Are you going to put newlines in there between each image? or just spaces? I’ll put in both for this example, checking if there’s a newline. You would want something like this in your functions.php: add_shortcode(‘my_gallery’, ‘gallery_function’); function gallery_function($atts, $code=””){ $files=preg_split( ‘/\s+/’, $code ); // Added in from Jan’s comment. foreach($files as $img){ if($img==””) continue; … Read more

how to add three default images to wordpress?

You can see how the code is put to work in functions.php of TwentyEleven theme, line 135 – 195. The codes to register your images are: add_custom_image_header( ‘twentyeleven_header_style’, ‘twentyeleven_admin_header_style’, ‘twentyeleven_admin_header_image’ ); register_default_headers( array( ‘wheel’ => array( ‘url’ => ‘%s/images/headers/wheel.jpg’, ‘thumbnail_url’ => ‘%s/images/headers/wheel-thumbnail.jpg’, /* translators: header image description */ ‘description’ => __( ‘Wheel’, ‘twentyeleven’ ) ), … Read more

New to wordpress, Question about editing PHP

A plugin in WP is a concept more related to user friendly packaging of code, rather than mechanics of code itself. I don’t want to overly confuse you, but in practice plugin can act like a theme and theme can perform functions common to plugins. Just be aware that these things are more about semantics … Read more

Importing Geo data into wordpress database

To answer your question… Yes, it’s doable. But to give you some pointers into the right direction… I’ve known some folks who have had good success using the WordPress Importer plugin. You could conceivably export your geo data from your database (using whatever DB management tool you’re comfortable with) to the import format that this … Read more