• hi, last time i have ask for add the nr. of tags in the main page,
    and i had a good solution by a nice plug-in.
    right now i have the same problem, but with “category” in the main page.
    like you can see in my picture, i have only 13 categories listed in that page,
    but i have add more category that i can see under articles-categories in the
    acp page.
    it is possible to add the number of categories visible on the main page
    by a script or with a good plug-in ???
    thank very much.

    [img]https://i.imgur.com/SOLt25E.jpg[/img]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi again, @unottico1965
    I see you are more comfortable with plugins, so you can try:

    Choose the one that is best suited for you!
    Hope this helps!
    Kind regards,
    Vlad

    Thread Starter unottico1965

    (@unottico1965)

    hi Vlad, nice to see you again.
    in realty i had try before you 1 plug-in for the category,
    but it don’t worked, and also the other 2 you have wrote.
    i think it’s a bug of WordPress, but when you rename
    the plug-in “categorie” (italian language), i think that
    wp exchange this for the original one, and you can see
    only 13 categories.
    but when the plug-in you rename “categories” or “wp-categories”,
    the problema disappear.
    thank again.

    Happy you found a solution that works for you!
    Thanks for sharing your findings!

    Thread Starter unottico1965

    (@unottico1965)

    hi Vlad, can i ask you:
    if i want modify the original code of wp,
    where it make only 13 categories visibles
    on the main page, where is the part
    of code that i must go ???
    for write from 13 to infinite,
    how is possible to do ???
    thank very much.

    One should never modify the core wp code, because those changes will be lost when the ext update will happen.

    You should always use plugins or addional code to change the default behaviour.

    Thread Starter unottico1965

    (@unottico1965)

    ah ok, thank.
    so, if i want use additional code for make category infinite,
    is possible to have the code ???
    thank.
    i want try to have less plug-ins installed.
    thank again.

    Sure. Add this at the end of functions.php file in your theme’s folder!

    When you will update your theme this piece of code will be lost, so make sure you keep this code and insert it again if needed.

    add_filter( 'widget_categories_args', function( $args ){ $args['number']= 20; $args['orderby']= 'count';$args['order'] = 'DESC'; return $args;} );
    

    Modify 20 with your desired number.

    Please pay attention when editing theme’s files, so nothing breaks. It’s best to make a backup first!

    Hope this helps!

    Thread Starter unottico1965

    (@unottico1965)

    thank again.
    i can save the code.
    thank.

    • This reply was modified 4 years, 2 months ago by unottico1965.
    Thread Starter unottico1965

    (@unottico1965)

    hi, the code don’t work.
    is possible you have write it wrong ???
    some spaces, for example ?

    this one: widget_categories_args
    you have take from the english theme
    or you can change the code with
    another name ???

    That code should work regardless of what language you have your site in.

    I am sorry it doesn’t work for you. I can’t think of another suggestion.

    Thread Starter unottico1965

    (@unottico1965)

    hi Vlad, this is the situation before your code:
    [img]https://i.imgur.com/k44KoTH.jpg[/img]

    and this is from the acp:
    [img]https://i.imgur.com/5tQr095.jpg[/img]

    when i install your code:
    add_filter( ‘widget_categories_args’, function( $args ){ $args[‘number’]= 20; $args[‘orderby’]= ‘count’;$args[‘order’] = ‘DESC’; return $args;} );

    this is what happen:
    [img]https://i.imgur.com/MOJzy84.jpg[/img]

    1) it is possible to reach 20 categories like inside your code ???
    2) i see you have order by DESC, but if you look the last picture,
    it is not in that order.
    3) is possible your string is wrong ???

    thank you very much.

    Thread Starter unottico1965

    (@unottico1965)

    hi Vlad, i have partially solved the problem of category in widget.
    i have modify a little your code so:

    add_filter( ‘widget_categories_args’, function( $args ){ $args[‘number’]= 20; $args[‘orderby’]= ‘name’;$args[‘order’] = ‘ASC’; return $args;} );

    1) can be good to write “name” for categories or was “title” ???
    2) the problem is always the number of the list in category widget.
    they still stay only 14.

    thank you again.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘increase nr. of category main page’ is closed to new replies.