How to get unmodified post content?
It seems that the original content is unmodified if I access it like this: echo $post->post_content; And I do not save the post in the editor and do not use the visual editor. This is using WordPress 5.4.2.
You can use the get_the_excerpt filter to modify what’s printed by the_excerpt(): add_filter( ‘get_the_excerpt’, ‘wpse_367505_excerpt’ ); function wpse_367505_excerpt( $excerpt ) { return substr( $excerpt, 0, 50 ) . ‘ [Read More]’; } You can change the [Read More] text to whatever you’d like. Add this code to your theme’s functions.php file, and it should automatically … Read more
Correct way adding External classes to Custom Post type and output their methods to template
I just figured it out, just in case it might be helpful for anyone in future: There is an option available to exclude a particular category – categories_exclude So, the new rest API would be: https://www.example.com/?rest_route=/wp/v2/posts&per_page=100&categories_exclude=10
try the Yoast seo plugin. In the past few weeks, I tried switching to SEO audit plugins, most of them available options like declaring to search engines that No index pages / page2, page / n … I turned Back to Yoast Seo, Yoast Seo even in the free version, has a pre-installed token with … Read more
How to setup default value of post_id
WooCommerce seems to update the ‘last modified’ value of a product on every change. If you want to take a look at the source code, go to woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php and check the function update. This solution seems to work, however it could be improved to make sure it doesn’t mess up with anything else. Basically checks … Read more
Have you tried adding the paged parameter to your args for WP_Query? $args=array( ‘tag__in’ => $tag_ids, ‘post__not_in’ => array($post->ID), ‘posts_per_page’=>10, // Number of related posts to display. ‘caller_get_posts’=>1, ‘paged’ => $paged );
Going to leave the question, but I’ve just found that this is extremely easily achievable with Custom Fields if you don’t want rich text, and the Advanced Custom Fields plugin if you do. The fields are setup with ACF’s UI in the WP control panel, and then inserted in the page with simply: the_field(‘field_id’);
I have inserted a post’s content in homepage.php by the post-id. The font isn’t matching with the theme. How do I change font of this content?
It seems that the original content is unmodified if I access it like this: echo $post->post_content; And I do not save the post in the editor and do not use the visual editor. This is using WordPress 5.4.2.