Support » Plugin: List category posts » Display post titles only in category/tag pages

  • Resolved spiros

    (@spiros)


    Would something like that be possible? I.e. when one goes to a category or tag, only see the post titles listed in a numbered list.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter spiros

    (@spiros)

    I got it with this, is it possible to have all the category post titles displayed instead of pagination?

    <?php
            // Start the Loop.
            while ( have_posts() ) : the_post();
    ?> 
    — <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a><br />
    <?php endwhile; ?>
    Plugin Contributor zymeth25

    (@zymeth25)

    Sorry, I do not understand what you want to achieve. Please explain in detail. Maybe you mean currenttags=yes or categorypage=yes? Make sure to read the documentation.

    Thread Starter spiros

    (@spiros)

    Right. I don’t know if this can be achieved with the plugin or perhaps some other way or perhaps as an idea for extra plugin functionality.

    Currently, when one clicks to a category, this is paginated according to the number of posts setting in options > reading. I want the category posts to have no pagination, i.e. fully listed when clicking a category.

    Plugin Contributor zymeth25

    (@zymeth25)

    This plugin can generate an archive page like that but cannot ‘hijack’ native WordPress links to category or tag archives. You would have to manually add links to pages where you use LCP shortcodes and it would be a pain to implement and maintain.

    In your case it is better to just edit your theme’s template files. Here is some information on how to disable pagination for chosen categories:

    https://wordpress.stackexchange.com/questions/258482/disable-pagination-only-for-specific-category

    Thread Starter spiros

    (@spiros)

    Thanks for the great link!

    Is it possible to change it so that it applies to all categories? Where should I add that snippet? I tried using in functions.php or via Snippets plugin as:

    add_action( 'pre_get_posts', 'wpse_disable_pagination' );
    function wpse_disable_pagination( $query )
    {
      if ( is_category( 'mycategoryhere' ) )
      $query->set( 'posts_per_page', '-1' );
    }

    But did not take effect for the specific category I tested.

    I also tried this: https://stackoverflow.com/questions/53843370/wordpress-all-results-in-one-page-no-pagination

    • This reply was modified 1 month, 1 week ago by spiros.
    • This reply was modified 1 month, 1 week ago by spiros.
    • This reply was modified 1 month, 1 week ago by spiros.
    Plugin Contributor zymeth25

    (@zymeth25)

    Add it to your functions.php. I have tested it, it works. If it does not work for you, there might be another filter added to pre_get_posts by a plugin or something else.

    To disable pagination for all category archive pages:

    add_action( 'pre_get_posts', 'wpse_disable_pagination' );
    function wpse_disable_pagination( $query )
    {
      if ( is_category() )
      $query->set( 'posts_per_page', '-1' );
    }
    Thread Starter spiros

    (@spiros)

    Yes, THAT works! (not sure if the fact that I had Greek category slugs in the previous code impeded it from working). Magic! Is it possible to make it paginate if over 50 posts or something? A, got it, simply change -1 to 50.

    • This reply was modified 1 month, 1 week ago by spiros.
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.