开发者 |
wponlinesupport
anoopranawat pratik-jain piyushpatel123 ridhimashukla patelketan |
---|---|
更新时间 | 2024年11月6日 20:20 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 6.6.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
[sp_news]
To display only News 4 post:
[sp_news limit="4"]
Where limit define the number of posts to display.
If you want to display News by category then use this short code:
[sp_news category="category_ID"]
Enter category id to display categories wise.
Complete shortcode example:
[sp_news limit="10" category="category_id" grid="2" show_content="true" show_full_content="true" show_category_name="true" show_date="false" content_words_limit="30" ]
✅ Here is Template code
<?php echo do_shortcode('[sp_news]'); ?>
✅ Use Following Blog parameters with shortcode
[sp_news]
Please make sure that Permalink link should not be "/news" Otherwise all your news will go to archive page. You can give it other name like "/ournews, /latestnews etc"**As this plugin is created with custom post type, you can now add Gutenberg editor support for the plugin for writing the news post. For that we have added apply_filters. For more details please check plugin FAQ section.
apply_filters( 'sp_news_registered_post_type_args', $news_args );
The plugin adds a News tab to your admin menu, which allows you to enter news items just as you would regular posts.
If you are getting any kind of problem with news page means your are not able to see all news items then please save your Permalinks Structure for example
first select "Default" and save then again select "Custom Structure" and save.
✅ Checkout demo for better understanding
FREE DEMO | PRO DEMO
✅ Essential Plugin Bundle Deal
Annual or Lifetime Bundle Deal
✅ Features include:
[sp_news]
.Just add this code in your theme function.php file to enable/disable Gutenberg editor support for News Posts :
function prefix_gutenberg_editor_support($news_args){
$news_args['show_in_rest'] = false;
return $news_args;
}
add_filter( 'sp_news_registered_post_type_args', 'prefix_gutenberg_editor_support' );
No, not usually. But if you are getting "/news" page OR 404 error on single news then please update your permalinks to Custom Structure.
If you are getting this error, please go to Setting --> Permalinks and under Permalinks Setting select "Plain" radio button and save. Now again go to "Post name" radio button and save again. This will fix your issue.
Use [sp_news]
show_in_rest=> true
to enable the Gutenberg Editor support for News Posts or Not. For more details please check plugin FAQ section.