How do I pull post from standard post format?

The terms parameter will only accept custom post types and, like you mentioned, post-format-standard is not one. Try instead to use the ‘NOT IN’ operator to test against the custom posts you don’t want to display (all in this case): $query = array( ‘showposts’ => 5, ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘OR’, … Read more

Get title from IDs in a string

get_the_title takes an int, not an array of ints, and therefore returns a string, not an array of strings. So just break that bit out into a loop: $titles=””; foreach ($act_name as $act_name_item) { $titles .= ($titles ? ‘,’ : ”) . get_the_title ($act_name_item); }

WordPress text field in array problem

It looks like you may be creating an array around a single long string that needs to be split up into array elements (assuming $idsposts is a string and not an array). Try using $myposts = explode(“,”, $idsposts); Instead of just adding $idsposts as the only element of your $myposts array. You can also check … Read more

How to assign results to variables?

Best luck while you learn. $fivesdrafts = $wpdb->get_results( ” SELECT ID, post_title FROM $wpdb->posts WHERE post_status=”draft” AND post_author = 5 ” ); foreach ( $fivesdrafts as $fivesdraft ) { echo $fivesdraft->post_title; } This example has been sponsored by WordPress codex. In your case $wpdb->get_results( Should become like: $variable_to_print = $wpdb->get_results(

date_query problem

You’re looking for the get_adjacent_post function. This is a built-in wordpress function that you can use to get either the previous or next post from the current post. To get the next post: $next_post = get_adjacent_post( false, ”, false, ” ); To get the previous post: $prev_post = get_adjacent_post( false, ”, true, ” ); You … Read more

Convert Custom Post Data to Javascript Array for Autocomplete

$args = array( ‘post_type’ => ‘promo’ ); $loop = new WP_Query( $args ); $promos = array(); while ( $loop->have_posts() ) : $loop->the_post(); foreach((get_the_category()) as $category); $promos[] = $category->cat_name. ‘ – ‘ .get_the_title(); endwhile; echo ‘<script> jQuery(document).ready(function($) { var promoList=”.json_encode($promos) .”; $( “#auto-promo” ).autocomplete({ source: promoList }); }); </script>’;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)