I have a custom function in my theme that creates a dynamic sitemap.xml
file.
For that I’m using $myVar = get_posts( array(...) )
. In that array I need to exclude some pages.
I want to exclude some parent page and all its children pages.
I want to use only parent page slug to get an array of all the IDs of the parent and the children.
The problem: the 'exclude' =>
in the array()
accepts only an array of IDs. Not slugs.
How can I achieve it with some function (or some other way) to return an array of IDs by parent page slug including parent ID and all its children?
For the example let’s say the parent page slug is abc
.
Thanks ahead.
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com