Answer the question
In order to leave comments, you need to log in
How to make multiple pieces in wordpress?
Hello.
I have several tasks and therefore several questions about Wordpress at once.
There is a blog site on WordPress and the main page is the posts page (blog). I need to somehow make one category, make a slightly different design for posts in this category (not like for all posts) and make sure that this category is not displayed in the main blog (as posts) and is not displayed in the rss feed.
I plan to publish short news in this category that do not require a separate post. ... for example, to scroll through them with arrows.
And display this category, for example, after 1-2 blog posts on the main page.
Please, tell me, maybe there is some kind of plugin created specifically for this. Or maybe someone can come up with a solution.
In short, I need a place (a category or a tag, or I don’t know which is better) where I can publish either a small text news or a video post that will not be indexed by search engines, will not go to the rss feed. And it will just be somewhere on the site, and which does not require a separate post (that is, there is no more link).
Thank you very much )
ps if I find an example site, I'll update it )
Answer the question
In order to leave comments, you need to log in
There is a bad option - to make a separate taxonomy for such posts .
There is a good option:
1. Disable category display in RSS:
function myFilter($query) {
if ($query->is_feed) {
$query->set('cat','-5'); //Don't forget to change the category ID =^o^=
}
return $query;
}
add_filter('pre_get_posts','myFilter');
function exclude_post($query) {
if ($query->is_category)
{$query->set('post__not_in', array(1, 2) );} // id записи (поста)
return $query; }
add_filter('pre_get_posts','exclude_post');
привет, сделай отдельную страницу в теме своей.
потом в админке содаешь страницу и выбираешь для него шаблон
Запрещаешь вывод записей из нужной тебе рубрики на главной и в рсс (в гугле доступно), через роботс.тхт запрещаешь индексацию данной рубрики. Создаешь отдельный шаблон для вывода записей single2.php и пихаешь туда только вывод данной категории без excerpt без more(гугли: как вывести посты категории). При создании заметки выбираешь данный шаблон в админке, или пихаешь вывод данной рубрики в index.php. С такими вопросами нужно газовать к документации с описанием функций вывода, исключения, формирования, т.е. нужно изучить глубоко.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question