setup_postdata in “loop-handling” php file called via $.ajax

Solved by getting author, post_date, permalink & excerpt manually without setup_postdata: $excerpt = myCustomExcerptFunction($post, 35); $post->post_excerpt = $excerpt; // Permalinks $post->post_permalink = get_post_permalink($post->ID); // Author $authorObjekt = get_userdata($post->post_author); $post->post_author_displayname = $authorObjekt->data->display_name; $post->post_author_nicename = $authorObjekt->data->user_nicename; // Date $post->post_date_wpformat = date_i18n( get_option( ‘date_format’ ),

WordPress Tags in class

Where are you getting these tags from? Typically, to get a list of tags attached to a post, you’d do: $some_tags = wp_get_post_tags( $post_id); and then itterate through as such: foreach($some_tags as $tag) { do stuff }

Display single post inside accordion based on form submission results

Closing off as the issue is resolved. For anyone interested, the result is as follows (refer to the code detailed above for the initial DB-table connections, as the code below refers to the output only): if (isset($SelectedLocationID) && isset($SelectedSchoolID)) { ?> <div id=”resultsDiv”> <div id=”resultsHead”> <h3>Search results for routes between:</h3> <b><?php echo $selectedLocationName; ?></b> and … Read more

Custom Post Type Order Index Loop

You’re only referencing the event date in your query, which is why you’re not getting normal posts (because I assume they don’t have an event date). You can use “orderby” with multiple values (separated by a space), so you should be able to change it to: ‘orderby’ => ‘meta_value date’ That should mean that the … Read more

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