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.
WordPress empty page! what is wrong with this code?
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
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.
This worked for me: <?php if($_GET[‘module_search’] && !empty($_GET[‘module_search’])) $keywords = $_GET[‘module_search’]; ?> <!– Set args for search of cpt –> <?php $args = array( ‘post_type’ => ‘lectures’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘keywords’, // name of custom field ‘value’ => ‘[[:<:]]’.$keywords.'[[:>:]]’, // matches exaclty “123”, … Read more
It seems like you should use hierarchies of categories, because it sounds like ‘Tiger’ belongs to the group ‘Animals’. You can get the parent category with $category->parent so if page category was Tiger, and parent category was Animals, this would then work. Let me know if that would work for you and if you need … Read more