- This topic has 18 replies, 4 voices, and was last updated 1 year, 2 months ago by
Fernando.
-
AuthorPosts
-
July 20, 2022 at 5:39 am #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:
This is the live url still in jooma:
https://www.drleyes.com/jurisprudencias/civil
Apreciate your help.
Rafael
July 20, 2022 at 7:25 am #2288438David
StaffCustomer SupportHi there,
is the search field and number of results selector also required ?
July 20, 2022 at 8:04 am #2288640Rafael
Hi David……
It would be great it has too the search option…..but if it is too complicate then obviate it….
July 20, 2022 at 10:20 am #2288777Ying
StaffCustomer SupportIf 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.
July 20, 2022 at 1:12 pm #2288908Rafael
Thanks…but it doesn’t solve my case…I dont find the way to display a category post as a list………
July 20, 2022 at 5:56 pm #2289012Fernando 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.
July 20, 2022 at 6:53 pm #2289032Rafael
Thanks….Fernando but it does not work……..
July 20, 2022 at 6:58 pm #2289036Fernando Customer Support
How did you add it?
Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets
Kindly let us know.
July 21, 2022 at 7:20 am #2289553Rafael
Yes I add it in snippet plugin….and call it in a page as a short code [get-all-categories-shortcode’]
July 21, 2022 at 9:56 am #2289844Ying
StaffCustomer SupportCan you make sure the shortcode you are using is
[get-all-categories-shortcode]
?July 21, 2022 at 10:28 am #2289871Rafael
Well..is it within or wothout ‘
I’ll try with….[get-all-categories-shortcode]….that is different than [get-all-categories-shortcode’]
July 21, 2022 at 11:37 am #2289925Ying
StaffCustomer SupportYes, without the
'
makes a significant difference.July 21, 2022 at 2:19 pm #2290021Rafael
ok…is working now…It show all categories…Thanks…..
And if I want do display a specific category??…..and insert a paging??
July 23, 2022 at 4:32 am #2291261Rafael
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
July 24, 2022 at 11:58 am #2292368Ying
StaffCustomer SupportThis 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.
-
AuthorPosts
- You must be logged in to reply to this topic.