stoicshohag
Member
Posted 1 year ago #
I'm running a lawyer Law firm information website. I faced a problem when i want to publish Lawyer/law firm list in a page from whole categories.
http://www.worldlawyerinfo.com/areas-of-practice
Now, from this page, i want "By Country and City" to publish in another page.
i used this code here: `<b>
<?php wp_list_categories() ?>
</b>`
What do i do?
Any kind of help will be appreciated.
Thanks
To exclude the category, use the exclude_tree argument:
$args = array(
'exclude_tree' => '62', // The category id of the parent
);
wp_list_categories($args);
To list only the children of the category, use this:
$args = array(
'child_of' => '62',
);
wp_list_categories($args);
stoicshohag
Member
Posted 1 year ago #
vtxyzzy @ Thanks a lot!
see it: http://www.worldlawyerinfo.com/by-country-city
how to remove "catagorie" text ?
See all wp_list_categories parameters.
You suppress the outer list item by using the 'title_li' parameter:
$args = array(
'child_of' => '62',
'title_li' => '',
);
stoicshohag
Member
Posted 1 year ago #
great man, thanks again !
If your problem has been solved, please use the dropdown on the right to mark this topic 'Resolved' so that anyone else with this question can see that there is a solution.
stoicshohag
Member
Posted 1 year ago #
another ques: if i don't want a category to be published in page. then what ?
ok. i'll change it to resolved.
Sorry, I don't understand your question. Please explain with an example.
stoicshohag
Member
Posted 1 year ago #
suppose, go to http://www.worldlawyerinfo.com/areas-of-practice here. then i want to remove "By Country and City" category from this page . how to ?
See my post above under this:
To exclude the category, use the exclude_tree argument:
stoicshohag
Member
Posted 1 year ago #
Did you change '62' to the id of your parent category?
Please post the code for your $args array.
stoicshohag
Member
Posted 1 year ago #
ya i changed.
i put there
<?php
$args = array(
'exclude_tree' => '932', 'title_li' => 'Areas of practice'
);
wp_list_categories($args);
?>
but same results
If 932 is the same id you used to show only that category on the "By Country and City" page, I cannot explain it.