category_description() shows raw html after version 3.x?
Actually HTML is stripped on input, using wp_filter_kses function hooked into pre_term_description filter. So if this hook isn’t removed HTML would be stripped.
Actually HTML is stripped on input, using wp_filter_kses function hooked into pre_term_description filter. So if this hook isn’t removed HTML would be stripped.
You need to get the published posts in the category then run wp_update_post() inserting the new status. Here is a quick function. I am attaching it to admin init. I would also turn it off after your statuses are updated. function wpse_55018_get_update() { for( $i = 0; $i < 10; $i++ ) { // Runs … Read more
Short answer: No, it is impossible, if we are talking about WP way, because it was not provided by WP architecture. It could be done if you create your own plugin (or implement it as a part of theme). To do it you need to create custom table and implement logic for saving comments and … Read more
You’ll need to first grab the posts, then grab the attachments that are children of said posts. $my_query = new WP_Query( array( ‘meta_key’ => ‘my_hash’, ‘nopaging’ => true, ‘orderby’ => ‘meta_value’, ‘fields’ => ‘ids’, ‘cat’ => ’60’, )); if ( $post_ids = $my_query->get_posts() ) { $post_ids = implode( ‘,’, $post_ids ); $atts_ids = $wpdb->get_col( “SELECT … Read more
If you take a look at the WordPress Codex ‘post_excerpt’ is not a valid parameter for the ‘orderby’ parameter For this reason it cannot be done through WP_Query(). If you don’t mind, why are you trying to sort by post_excerpt in the first place?
This is main function of the import process. function menu_recursive_output( $branch_objet, $parent_id, $level ) { // JUST FOR COUNTING ITEMS static $counter = 1; if ( $level ) { // CHECK IF ITEM EXISTS ALREADY // IF SO, THIS WILL RETURN ARRAY CONTAINING ID OF EXISTING ITEM $created_cat = term_exists( $branch_objet->name, ‘category’, $parent_id); // IF … Read more
If you use get_terms(), then you can retrieve all terms for a given taxonomy (this includes category as well as post-tag). To get the category on a category archive page, you can use get_category( get_query_var( ‘cat’ ) ) which will give you an object of the currently displayed cat archive page. So the actual term … Read more
wp_list_categories (‘style = none’) will echo its content as it goes. It won’t pass back string that you can replace. You need to use the wp_list_categories filter to strip the <br /> tags. add_filter( ‘wp_list_categories’, function($str) { return str_replace(‘<br />’,”,$str); } ); wp_list_categories(‘style=none’);
Move what you are calling the “standard link ending” to the end of the function, instead of the beginning. class CategoryThumbnail_Walker extends Walker_Category { // A new element has been stumbled upon and has ended function end_el( $output, $category, $depth, $args ) { // Get one post $posts = get_posts( array( // …from this category … Read more
The ACF API functions normally work with the current post’s ID. Taxonomies and Users work a bit differently, you have to supply the ID of the object you want to fetch fields from. $category_id = ‘category_’ . get_queried_object_id(); $field = get_field( ‘post_slider_projects’, $category_id ); See get_field in the documentation for more info.