[Support request] Posts as List

Home Forums Support [Support request] Posts as List

Home Forums Support Posts as List

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #2288352
    Rafael

    Hi:

    First, thanks a lot for all the help I’ve recieved. I’m still working on transfer my site drleyes.com from joomla to worpress.

    I need to know if it is possible to display specific category of post as a list without using a plugin, something like this:

    https://ibb.co/S65pjfn

    This is the live url still in jooma:

    https://www.drleyes.com/jurisprudencias/civil

    Apreciate your help.

    Rafael

    #2288438
    David
    Staff
    Customer Support

    Hi there,

    is the search field and number of results selector also required ?

    #2288640
    Rafael

    Hi David……

    It would be great it has too the search option…..but if it is too complicate then obviate it….

    #2288777
    Ying
    Staff
    Customer Support

    If you just want to show the posts from a specific category, you can give the query loop block of GenerateBlocks a try:
    https://docs.generateblocks.com/article/query-loop-overview/

    To add the search function would not be very easy.

    #2288908
    Rafael

    Thanks…but it doesn’t solve my case…I dont find the way to display a category post as a list………

    #2289012
    Fernando
    Customer Support

    Hi Rafael,

    How are you adding the view count? Is it through a plugin? If you can get the term meta field name of the view count, we can add it as well.

    The search functionality will be much complicated.

    For instance, here a PHP snippet you may add to retrieve all categories on a table with a shortcode – [get-all-categories-shortcode]:

    function get_all_categories() {
        $categories = get_categories();
    	if ($categories) {
    		echo '<table class="category-list"><tr><td><h3>Titulo</h3></td></tr>';
    		foreach($categories as $category) {
    			echo '<tr><td><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></td></tr>';
    		}
    		echo '</table>';  
    	}
    }
    add_shortcode( 'get-all-categories-shortcode', 'get_all_categories' );

    Kindly let us know.

    #2289032
    Rafael

    Thanks….Fernando but it does not work……..

    #2289036
    Fernando
    Customer Support

    How did you add it?

    Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets

    Kindly let us know.

    #2289553
    Rafael

    Yes I add it in snippet plugin….and call it in a page as a short code [get-all-categories-shortcode’]

    #2289844
    Ying
    Staff
    Customer Support

    Can you make sure the shortcode you are using is [get-all-categories-shortcode]?

    #2289871
    Rafael

    Well..is it within or wothout ‘

    I’ll try with….[get-all-categories-shortcode]….that is different than [get-all-categories-shortcode’]

    #2289925
    Ying
    Staff
    Customer Support

    Yes, without the 'makes a significant difference.

    #2290021
    Rafael

    ok…is working now…It show all categories…Thanks…..

    And if I want do display a specific category??…..and insert a paging??

    #2291261
    Rafael

    Something like this is what I need, but this is a plugin.

    https://www.calculadoralaboral.com/lista-codigo-de-trabajo/

    It would be great if users may have the option to select how to show posts by category, because some post need to be shown as block and other as list.

    Maybe developing some option in the theme.

    Rafael

    #2292368
    Ying
    Staff
    Customer Support

    This is something that we won’t integrate into the theme, as we’ve developed the function into GenerateBlock’s query loop block.

    When you say list, does it have to be wrapped with <li> tag? Or does it just need to be looking like a list?

    If it’s the second scenario, I would strongly recommend giving GenerateBlock’s query loop block a try.

Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.