-
AuthorPosts
-
April 24, 2015 at 11:40 am #434033
Hi all,
I’ve got this issue: my webiste has a blog for Latest News, now I need to create another one with other topics organized in categories
What I can’t do is to edit the Category pages: for instance, I’d like to show only an excpert for posts, not the full post and I’d like to set a different sidebar from the one I have on Latest News blog.
I hope I explained myself clear.
Thank you.April 24, 2015 at 1:57 pm #434067Hey Gian Maria!
You can add one of the elements to display your posts and choose the specific category you would like to display.
Best regards,
YigitApril 24, 2015 at 2:10 pm #434080No, I guess I wasn’t so clear.
I created my post categories and my posts but I’d like to edit the category pages, these ones: http://kriesi.at/themedemo/?theme=enfold-overview
I’d like to have posts excperts and not full posts.
Plus, I can’t understand how to set a specific sidebar to the category pageApril 27, 2015 at 12:38 am #434936Hey!
1.) Add this in the functions.php file if you want to limit the post content:
add_filter( 'the_content', 'custom_excerpt_length', 999 ); function custom_excerpt_length($content) { if(is_archive()) { $content = wp_trim_words( $content, 50, '...' ); } return $content; }
2.) Use the Widget Logic plugin to create unique sidebars for category pages.
Cheers!
IsmaelApril 27, 2015 at 10:21 am #435120This reply has been marked as private.April 28, 2015 at 2:11 pm #436011Forgive me if I insist, but I really need your help.
April 28, 2015 at 4:55 pm #436190Ok, I solved the excperts problem installing the Advanced Excpert plugin.
But I still can’t figure out how to set a specific sidebar to the Category page (which is showing the default sidebar blog).
Thanks.April 29, 2015 at 3:22 pm #436731Hi!
Did you install the widget logic plugin? Go to Appearance > Widgets then add the widget that you want to display to the category page in the “Displayed Everywhere” or the “Sidebar Blog” widget area. When you edit the widget, you’ll see a Widget logic field. Add the conditional function there. For category or archive pages, use the is_category function:
is_category('23')
You can use the Category ID, Category Title, Category Slug or Array of IDs, names, or slugs. https://codex.wordpress.org/Function_Reference/is_category
Cheers!
IsmaelApril 29, 2015 at 3:46 pm #436759hi Ismael,
I had widget logic and already tried to do what you suggest but it doesn’t work.
If I do this, the widgets just disappear from the sidebar and are not added to the category page sidebar.
Pleae, read the private reply above where you can find the links, it should be easier to get what I mean.April 30, 2015 at 11:17 am #437318Hey!
Works fine on our installation. Please post the login details here. We’ll create an example.
Regards,
IsmaelApril 30, 2015 at 11:50 am #437334This reply has been marked as private.April 30, 2015 at 1:19 pm #437395are you doing something on my website? all my sidebars disappear.
April 30, 2015 at 3:35 pm #437519hi
don’t know what you did, but please don’t do it anymore. you made all my sidebars not active and I had to reactivated them all… such a mess!- This reply was modified 9 years, 6 months ago by gianmarizzi.
May 1, 2015 at 10:04 am #437946Hey!
I haven’t done anything yet. Is the sidebars OK now? I don’t want to login unless the sidebars are OK. Did you update the theme?
Cheers!
IsmaelMay 1, 2015 at 11:11 pm #438299Everything got f***ed up after update, but thought you were doing something.
May 4, 2015 at 8:29 am #438757This reply has been marked as private.May 4, 2015 at 5:49 pm #439151Hi all, still me and still need your help: I tried to use widget logic (I read all their instruction) but it didn’t help. I still can’t place my new sidebar on a category page (or archive page, don’t know the difference) AND on posts, of course.
I also tried to put all the widgets on the same sidebar and then exclude the widgets I don’t want to be shown but it didn’t work.
I really don’t know what to do.
Plese, help me.
Thanks.May 6, 2015 at 5:28 am #440106Hi!
This is public forum, please watch your language. Anyway, I added a text widget in the Displayed Everywhere widget area then add a conditional function so that it will only display in the GeoWorld category. http://www.geoclima.com/wp-admin/widgets.php
As you can see, the widget is visible in the specified category page: http://www.geoclima.com/category/thinkforward/geo-world/
And another category page without the text widget: http://www.geoclima.com/category/thinkforward/
Best regards,
IsmaelMay 6, 2015 at 9:21 am #440189Hi Ismale, sorry if my language seemed rude, I didn’t mean to.
Thanks for you help, but: how can I know the number of category? How to exclude “Archives” widget from the sidebar?May 6, 2015 at 9:35 am #440194One more thing: I also have other three languages and your example is not displayed on these languages. Do I have to translate widgets with Widget Logic?
May 8, 2015 at 4:00 am #441345Hey!
The fastest way to get the category id is in the category url. In this category, the id is “76”: http://www.geoclima.com/wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=76&post_type=post
Where do you want to show the Archives widget? It is currently placed in the Sidebar Blog widget that’s why it displays in the category pages. Use the widget logic field to control the visibility of the widget.
Refer to this link regarding the language settings: https://wpml.org/2011/03/howto-display-different-widgets-per-language/
Note that you can add multiple conditional tags in a single widget. Something like this:
is_category(76) && ICL_LANGUAGE_CODE == 'en'
I modified the first widget: http://www.geoclima.com/wp-admin/widgets.php
Cheers!
IsmaelMay 8, 2015 at 9:17 am #441451Thank you very much Ismael, you are very kind.
I try to work at it as you suggested.May 9, 2015 at 4:27 am #441847May 12, 2015 at 10:29 am #442899Hi Ismael,
I’m still trying to work it out.
Your solution works for english, but I cannot replicate it on other languages even using conditional tags such as
is_category(76) && ICL_LANGUAGE_CODE == 'en'
Plus, I’m trying to show Archive widget only on category Latest News but the problem is the page News. So I’m trying this conditional tag
is_category(3) && is_page(1854)
but it doesn’t work.May 13, 2015 at 3:24 am #443484Hey!
I created a sample widget for the italian and german language: http://www.geoclima.com/wp-admin/widgets.php?lang=it&admin_bar=1
Italian: http://www.geoclima.com/it/category/ultime-notizie-it/
German: http://www.geoclima.com/de/category/neuigkeiten/Latest New with Archive widget: http://www.geoclima.com/category/news/
Always put the widgets inside the Displayed Everywhere widget area.
Regards,
IsmaelMay 15, 2015 at 9:17 am #444829Ok, I work it out.
Thanks a lot. -
AuthorPosts
- The topic ‘Edit Category page’ is closed to new replies.