Accessing WPDB Multidimensional JSON Array w/ Javascript

Looks like you want to use something like result = $.parseJSON(data). Then you can access the data with result.win_id, for example. As an aside, you should sanitize the input to that database query using prepare with something like: $wpdb->get_results( $wpdb->prepare( “SELECT * FROM wp_winners WHERE user_id=%d”, $user_id ) );

wordpress JSONAPI introspector always limits number at 10?

I’m answering my own question because it might be useful to someone else sometime. After reading through the somewhat sparse documentation on the wordpress plugin directory and getting nowhere. I found a variable in the JSON API code here’s how it works PS -1 just mean “all”: $json_api->query->count=-1; $posts = $json_api->introspector->get_posts(array(‘post_type’ => array(‘post’,’tweet’,’gallery’,’video’,’music’), ‘post_parent’ => … Read more

Sort by page information by Ascending Numbers

Use custom fields wp_query Ex <?php $args = array( ‘post_type’ => ‘page’, ‘meta_query’ => array( array( ‘key’ => ‘mytitle’, ‘value’ => ‘title’, ‘orderby’ => ‘mytitle’, ‘order’ => ‘DESC’ ), ) ); $query = new WP_Query( $args ); if ( have_posts() ) while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <tr> <td><?php echo the_field(‘educational_ranking’); ?></td> <td><a href=”https://wordpress.stackexchange.com/questions/60150/<?php … Read more

Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]

Not sure if that’s what you need, but take a look. // Can be put into function.php if ( !is_admin() ) { add_action( “wp_enqueue_scripts”, “enqueue_scripts”, 11 ); } function enqueue_scripts() { // Theme CSS (style.css) wp_enqueue_style( ‘style-file’, get_template_directory_uri() . ‘/style.css’,false,’1.0′,’all’ ); // JS wp_register_script( ‘script’, get_template_directory_uri() . ‘/your-script.js’, array(‘jquery’) ); wp_enqueue_script( ‘script’ ); } Or … Read more

Is there a way of putting the facebook social plugins into page template php files?

Go to Facebook developers site For example, the Like Plugin http://developers.facebook.com/docs/reference/plugins/like/ Generate the code. You’ll get the generated code back in 2 blocks. The first is the SDK that must be added once on your page… preferably after the opening <body> tag. Depending on your theme you can paste that directly into header.php. If you … Read more