Widget area for individual posts (custom post type)?

Assuming that your theme still has the_content to populate that area you can use the_content filter to populate is. Because widgets normally echo their output you would also need to buffer output. Like this: add_filter (‘the_content’,’wpse304648_widget_content’); function wpse304648_widget_content ($content) { if (get_post_type == ‘your_cpt_name’) { ob_start (); .. execute widget $content = ob_get_contents(); ob_end_clean(); } … Read more

Autofill advanced custom field with user data

Yes, it can be done (it’s almost always true ;))… The question is how to do this? 😉 And here is the solution… You’ll have to use acf/load_field filter: function set_acf_field_default_value( $field ) { switch ( $field[‘name’] ) { case ‘name_provider’: $field[‘value’] = ‘PUT YOUR VALUE HERE’; break; } return $field; } add_filter(‘acf/load_field’, ‘set_acf_field_default_value’ ); … Read more

CPT: multiple loops with different terms

Have found the solution I only have to add the right tax_query… $posts_info = new WP_Query(array( ‘post_type’ => ‘tarife’, ‘posts_per_page’ => 3, ‘post_status’ => ‘publish’, ‘post__in’ => $products, ‘orderby’ => ‘title’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘tarif_kategorie’, ‘field’ => ‘slug’, ‘terms’ => ‘info’, ), ), )); $posts_gf = new WP_Query(array( ‘post_type’ => ‘tarife’, ‘posts_per_page’ … Read more

Custom post pagination not working

Thanks to Milo’s comment I could find a solution. In my home.php I have deleted the custom query and inserted: <div class=”news-content col-12 col-xl-8″> <div class=”row”> <h1>News</h1> </div><!– .row –> <div class=”row”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); if(has_post_thumbnail()) :?> <div class=”news-wrapper col-12 col-xl-6″> <div class=”news-date”> <?php the_time(‘j.m.Y’); ?> … Read more

Ajax load more inside custom post type taxonomy

Assuming the function hooked to the action load_posts_by_ajax is your load_posts_by_ajax_callback() code (seems a reasonable assumption), the query arguments can be easily modified. You mention “displays only 3 posts” which is what the code is designed to do. If you wish to show 10 posts, update the posts_per_page argument listed. ‘posts_per_page’ => ‘3’, The bigger … Read more