Mohit
Forum Replies Created
-
Forum: Plugins
In reply to: [Yoast SEO] How to Remove Yoast SEO breadcrumb json schema completely?Not Resolved, Yoast is dead now
Forum: Plugins
In reply to: [Yoast SEO] How to Remove Yoast SEO breadcrumb json schema completely?Is Yoast SEO team #dead
Forum: Plugins
In reply to: [Yoast SEO] How to Remove Yoast SEO breadcrumb json schema completely?I tried everything, that is available there, nothing is working fine.
Please provide me a solution that is tested in real environment, not only documented guide.
i also try this but applied on default posts not on cptui posts
function get_first_paragraph($post_id, $num_words) { $str = wpautop(get_post_field('post_content', $post_id)); $str = substr($str, 0, strpos($str, '</p>') + 4); $str = strip_tags($str, '<a><strong><em>'); $str = wp_trim_words($str, $num_words); return $str; } function custom_archive_description($description) { if (is_category() || is_tag()) { global $wp_query; $term = $wp_query->get_queried_object(); $description = get_first_paragraph($term->description, 20); // Change "20" to the desired word limit } return $description; } add_filter('get_the_archive_description', 'custom_archive_description');
But you can see in the screenshot, we are using
the_excerpt()
and that is working, see the second post in screenshot,But CPTUI post named “Testing” is not working in my instance.
Note: This problem is only when i am not filling the excerpt box, but i am using yoast seo for descriptions not default excerpt box. Description is not taken from the first lines of the post body by plugin automatically.
You can understand what I’m trying to say, right?
By searching support forum, my problem was solved. Thanks
Adding all CPTUI post types to the archives beacuse WordPress does not include custom post types in the archives, paste this code in functions.php
function my_cptui_add_post_types_to_archives( $query ) { // We do not want unintended consequences. if ( is_admin() || ! $query->is_main_query() ) { return; } if ( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { $cptui_post_types = cptui_get_post_type_slugs(); $query->set( 'post_type', array_merge( array( 'post' ), $cptui_post_types ) ); } } add_filter( 'pre_get_posts', 'my_cptui_add_post_types_to_archives' );
Forum: Reviews
In reply to: [WordPress Popular Posts] Best Plugin in WordPress RepositoryThanks,
But,
You suggested me, we did that. That’s enough for me.
Forum: Reviews
In reply to: [WordPress Popular Posts] Best Plugin in WordPress RepositoryThanks for the reply,
This is exactly what we were looking for. Only for this work we have to install heavy plugin like Jetpack. Which is not right in our view.
Forum: Reviews
In reply to: [WordPress Popular Posts] Best Plugin in WordPress RepositoryThis one was solved..
“Popular Post list not updated frequently if we set time range ’12 hour or less’ with Cloudflare in Standard caching level.”by setting custom time range:-
‘range’ => ‘custom’,
‘time_quantity’ => 1,
‘time_unit’ => ‘hour’,- This reply was modified 2 years, 3 months ago by Mohit.