posts from multiple post types in one slider

Multiple Post type in one slider Shortcode Using This Shortcode For Owl Carousel In Your Page And Add Your Custom Post Type In The Arguments of Query Put This Code in Your functions.php add_action( ‘wp_enqueue_scripts’, ‘my_child_enqueue_styles’ ); function my_child_enqueue_styles() { wp_enqueue_style(‘styleowl’,’https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/assets/owl.carousel.min.css’); wp_enqueue_style(‘style1′,’https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/assets/owl.theme.default.min.css’); wp_enqueue_script(‘pro-owl’,’https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.1/owl.carousel.min.js’,array( ‘jquery’ ), ”, false); wp_enqueue_script(‘jquery’,’https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js’,false); } add_shortcode(‘post_slider’,’custom_slider’); function custom_slider(){ $args = array( … Read more

my post slug gets really long and I can’t change it

This is because you’re using characters that aren’t valid in URLs: קידום-מנצח URLs only allow a limited subset of ASCII characters In order for these characters to work in a URL, they have to be encoded. For example if I visit example.com/foo bar/ the space isn’t valid in URLs, so it gets turned into example.com/foo%20bar/, … Read more

How to style archive post titles… but only those posts who have comments?

Use have_comments() function. Example: <?php if ( have_comments() ) : ?> <h2 class=”has-comments”><a href=”https://wordpress.stackexchange.com/questions/363222/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php else : ?> <h2><a href=”https://wordpress.stackexchange.com/questions/363222/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php endif; ?>

How to get post with associated categories and tags names instead of ids with rest api?

When I copy/pasted your code I got an error message because enf_register_categories_names_field() wasn’t defined. When I cleaned up your code and wrapped the register_rest_field() in a function called “enf_register_categories_names_field” it worked as expected. function ag_filter_post_json($response, $post, $context) { $tags = wp_get_post_tags($post->ID); $response->data[‘tag_names’] = []; foreach ($tags as $tag) { $response->data[‘tag_names’][] = $tag->name; } return $response; … Read more

How to exclude posts that already appear in the main loop, from the category loop

<?php get_header(); ?> <section class=”content latest”> <h2>Latests 20 posts</h2> <ul> <?php $the_query = new WP_Query( ‘posts_per_page=20’ ); ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <?php $excludeID[] = $post->ID; ?> <li> <!– post thumbnail linking to the single post page –> <?php if ( has_post_thumbnail() ) : ?> <a href=”https://wordpress.stackexchange.com/questions/366403/<?php the_permalink(); ?>” … Read more