Jump to content


Photo

Constraining list to one deep


  • Please log in to reply
7 replies to this topic

#1 Simeon108

Simeon108
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 February 2017 - 04:47 PM

Forgive me, but I am ignorant of PHP with the exception of copying snippets from various sources. I have successfully used this snippet to call the children of a particular WordPress article in a list:

<?php  wp_list_pages('title_li=&child_of=12442') ?>
 
I would like to constrain this call to just the children one deep, i.e., not the grandchildren, etc.
 
Can anyone tell me what this code would be?
 
Thank you,
 
Brother Simeon
Light of the Spirit Monastery
ocoy.org


#2 Jacques1

Jacques1
  • Gurus
  • Turtles all the way down
  • 3,235 posts

Posted 10 February 2017 - 06:37 PM

Have you read the documentation? I can see a “depth” parameter there.



#3 Simeon108

Simeon108
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 February 2017 - 08:18 PM

I know there is a parameter, I don't know how to implement it. And I don't want to become a PHP expert, I just want a plug-and-play solution. Give me a finished line of code and I am a happy duckling.



#4 Jacques1

Jacques1
  • Gurus
  • Turtles all the way down
  • 3,235 posts

Posted 10 February 2017 - 08:55 PM

I'm sure there are many things you want. The difficult part is to get them.

 

What I can do is move your thread to the job section. Some programmers are willing to do small jobs like this one.



#5 Simeon108

Simeon108
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 February 2017 - 11:37 PM

I undertand the 'title_li=&child_of=12442' part, and I understand that to call 1 deep is depth=1 but I don't know how to combine them into a single command. I know this is elementary to those who know, but I am not among the learned.

 

Can someone show me how to combine them?

 

Thank you.



#6 Jacques1

Jacques1
  • Gurus
  • Turtles all the way down
  • 3,235 posts

Posted 11 February 2017 - 11:55 PM

C'mon, is this your first day on the Internet? Have you never heard of Google?

 

Hint: The ampersand symbol separates the parameters.



#7 Simeon108

Simeon108
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 February 2017 - 05:21 PM

I will try working with the ampersand. Thank you.



#8 Simeon108

Simeon108
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 February 2017 - 07:41 PM

That did it. Thank you.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users