Skip Navigation

[Resolved] $parent doesn't work when displaying brother pages

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Tagged: 

This topic contains 6 replies, has 4 voices.

Last updated by kelvinL-2 5 years, 5 months ago.

Assigned support staff: Shane.

Author
Posts
#287225

Hi,

Followed your tutorial here: https://toolset.com/documentation/user-guides/displaying-brother-pages/

However when I run it, it only displays children of the current post, not brothers. So the $parent tag is useless and is completely ignored.

How can this be fixed?

Thanks

#287435

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nathan,

The instructions that are in the url that you sent is intended to display the child posts of the Parent Post.

This implies that the pages that are displayed on the Parent page are brothers.

The id="$parent" tag is used when you want to display the contents of the Parent page in the Child page.

Let me know if this was clear.

#287443

Hi,

Yep, really unclear. Tutorials could do with some more example.

I ended up making my own custom shortcode to get the current posts parent ID and return it to a view which get's the child posts of that ID. Props on the custom shortcode engine though works really well once you get the hang of it.

Thanks

#293417

Tutorials on this site could use A LOT more work. They are written in a manner where everybody who reads them is left guessing and then being pushed from the free Types plugin to the purchasing the paid Views plugin.

Its a great plugin, very very powerful. If the tutorials were improved to back it all up, the support forums would have a lot less questions (at least from me! lol), and a lot more people would want to buy the plugin for sure.

Hopefully they're selling enough to make it worthwhile to improve them.

#294045

Dear nathanW-4,

Do you mind sharing your custom shortcode which I can get the current posts parent ID?

Kelvin.

#294136

Hi Kelvin,

Sure, see below - add this to your functions.php, then add the available shortcode in views settings parentid

This website keeps ruining the code I paste, so I've placed it here for you: http://pastebin.com/rjmkjSmm

#295060

Hi nathanW-4,

Many thanks for your code, it is nice.

Kelvin.