How to display post meta bellow every posts

Getting and displaying the categories within your posts loop can be done for example like this, $categories = get_the_category(); if ( $categories ) { $cat_links=””; foreach ( $categories as $category ) { $cat_links .= sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/346001/%s”>%s</a>’, esc_url( get_category_link( $category->term_id ) ), esc_html( $category->name ) ); } printf( ‘<div class=”categories”><span class=”title”>%s</span>%s</div>’, esc_html__( ‘Categories:’, ‘text-domain’ ), … Read more

WordPress Slick Slider + Magnific Popup

Yes, it is possible to get original image and a smaller version of it. Use wp_get_attachment_url($id) to get the full url and wp_get_attachment_image_src($id,$size) for the smaller version. EDIT: You can get the name of the original uncropped (full) image from the attachments post_meta. Then replace the cropped file name with the original name in the … Read more

Show different number of posts on first Blog listing page

I took me a while to wrap my head around this, but finally, I made it work. I will share my solution here in case someone else is looking to implement a similar layout: <ul class=”post preview grid grid–blog”> <?php $do_not_duplicate = 0 ?> <?php if(!is_paged()): ?> <?php $args = array( ‘category_name’ => ‘featured’, ‘posts_per_page’ … Read more

gettint error 400 with AJAX

i can’t see the action parameter in your code it should be: let ajax = new XMLHttpRequest(); ajax.open(“GET”, search_x.ajaxurl + ‘?action=search_data’, true); ajax.send(); ajax.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { console.log(this.ajax); } }; see this reference about action parameter https://codex.wordpress.org/AJAX_in_Plugins