Tagged: , ,

Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #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.

    #434067

    Hey 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,
    Yigit

    #434080

    No, 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 page

    #434936

    Hey!

    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!
    Ismael

    #435120
    This reply has been marked as private.
    #436011

    Forgive me if I insist, but I really need your help.

    #436190

    Ok, 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.

    #436731

    Hi!

    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!
    Ismael

    #436759

    hi 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.

    #437318

    Hey!

    Works fine on our installation. Please post the login details here. We’ll create an example.

    Regards,
    Ismael

    #437334
    This reply has been marked as private.
    #437395

    are you doing something on my website? all my sidebars disappear.

    #437519

    hi
    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.
    #437946

    Hey!

    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!
    Ismael

    #438299

    Everything got f***ed up after update, but thought you were doing something.

    #438757
    This reply has been marked as private.
    #439151

    Hi 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.

    #440106

    Hi!

    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,
    Ismael

    #440189

    Hi 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?

    #440194

    One 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?

    #441345

    Hey!

    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!
    Ismael

    #441451

    Thank you very much Ismael, you are very kind.
    I try to work at it as you suggested.

    #441847

    Hey!

    Alright. Let us know if you figured it out.

    Regards,
    Ismael

    #442899

    Hi 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.

    #443484

    Hey!

    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,
    Ismael

    #444829

    Ok, I work it out.
    Thanks a lot.

Viewing 26 posts - 1 through 26 (of 26 total)
  • The topic ‘Edit Category page’ is closed to new replies.