Tagged: x
-
AuthorPosts
-
January 1, 2017 at 8:56 am #1311613
smartrich19ParticipantHi, I tried to display posts from certain categories so I added this code in function.php of child theme
function my_home_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '39,30,38,32,37,42'); } } add_action( 'pre_get_posts', 'my_home_category' );but now I can’t see any post there.
Can you tell me what’s wrong?January 1, 2017 at 9:24 am #1311637
RupokMemberHi there,
Thanks for writing in! It should work if your category IDs are correct. You can try a plugin as suggested on the post you are following – https://community.theme.co/forums/topic/only-show-post-from-specific-categories-on-blog-page/#post-115592
Cheers!
January 1, 2017 at 10:20 am #1311689
smartrich19ParticipantFirst, I tried to use that plugin but my top slider wasn’t displaying all the slides so I added the code. My slider is working but posts are not being shown.
January 1, 2017 at 10:45 am #1311709
ThaiModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
January 1, 2017 at 11:04 am #1311716
smartrich19ParticipantThis reply has been marked as private.January 1, 2017 at 11:08 am #1311719
ThaiModeratorHi There,
Please move your code from the style.css to functions.php file:
function my_home_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '39,30,38,32,37,42'); } } add_action( 'pre_get_posts', 'my_home_category' );Regards!
January 1, 2017 at 11:18 am #1311725
smartrich19ParticipantOops! I didn’t noticed that I was in css file. I moved it but still posts are not showing.
January 1, 2017 at 11:51 am #1311747
smartrich19ParticipantWhat’s wrong now. Any Idea?
January 1, 2017 at 7:34 pm #1312031
RadModeratorHi there,
Your blog has used special feature specific to Ethos. It uses the custom query, which means you’ll have to do it directly to the custom query instead of adding that code. It’s called filterable index where you can manually add category at Admin > Appearance > Customizer > Ethos > BLOG OPTIONS > Category IDs then add 39,30,38,32,37,42.
Thanks!
January 2, 2017 at 11:16 am #1312925
smartrich19ParticipantHi, Thanks for reply. It was my first attempt to achieve my goal. But that thing display one category at a time. But I want all those categories at the same time 10 posts per page.
January 2, 2017 at 11:20 am #1312926
smartrich19Participanthttps://community.theme.co/forums/topic/ethos-filterable-index-shows-only-one-cat/
I saw code here to display all the categories. But I want to display from specific ones.
January 2, 2017 at 10:51 pm #1313645
ChristopherModeratorHi there,
Please add recent posts element, you can set category and offset options to display 10 posts from each category, please see : demo.theme.co/integrity-1/shortcodes/recent-posts
Hope it helps.
January 3, 2017 at 12:28 pm #1314499
smartrich19ParticipantI’m not sure the question is understood.
Ethos theme.
This appears to be an issue that users have discussed for some time.
You have a neat feature/function where you can choose to show only certainly categories when using the home page as a blog page.
But the way it works is not intuitive or the way other wordpress blog pages work.
If I choose to limit to 10 posts on the home page, and choose categories x, y and z, then I want the posts for all those categories to appear in chronological order …
The user needs to be able to see the 10 latest posts, or move on to the next 10, without choosing a category. This is a serious usability issue. A user isn’t going to understand they have to select a category to read the latest posts. If they don’t see something that catches their attention, the whole idea of having posts on the home page is pointless. They “will not know” they have to click on a drop down menu to find what they may not even know they are looking for.
Now, it’s nice they can select to read from only certain categories if they CHOOSE to do so.
However, the word “ALL” doesn’t mean I want “ALL” of my posts on the home page. It should mean I want “ALL” of my posts from my chosen categories on the home page … up to the delimiter when they will overflow to the next page.
————————————————————————————–
I think you’re theme is the best piece of work I have seen in many years of working with themes in WordPress and others (Like Joomla).
However, this bug is a major flaw which needs to be addressed. My programmer and I are going nuts dealing with what seems to be a simple issue …
Any help would be appreciated.
Thank you.
Rich
January 4, 2017 at 4:20 am #1315497
ChristianModeratorHey Rich,
Please add the code below in your Appearance > Customize > Custom > Global CSS
.x-filterable-category-group { display: block; visibility: visible; }Thanks.
January 4, 2017 at 9:39 am #1315916
smartrich19ParticipantHi there,
I did what you told me to, but nothing happened. Can you take a look yourself? -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1311613 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
