Site logo

Archived topic

Posts as List

18 replies · Started by Rafael on July 20, 2022

Viewing posts 1–15 of 19

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

Hi there,

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

Hi David......

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

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

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.

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

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

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

Well..is it within or wothout '

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

Yes, without the 'makes a significant difference.

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

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

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

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.

This archived topic is closed to new replies.