- This topic has 9 replies, 2 voices, and was last updated 4 years, 1 month ago by
Tom.
-
AuthorPosts
-
February 14, 2019 at 2:12 pm #810781
Florian
I use the following custom post type to redirect certain pages to their first child page. Is it possible to add something so it also adopts the child page’s thumbnail? Preferably in a way that it also automatically updates if I ever change it.
<?php /* Template Name: Go to first child */ $pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order"); if ($pagekids) { $firstchild = $pagekids[0]; wp_redirect(get_permalink($firstchild->ID)); } else { // Do whatever templating you want as a fall-back. } ?>
GeneratePress 2.2.2GP Premium 1.7.7February 14, 2019 at 5:13 pm #810853Tom
Lead DeveloperLead DeveloperHi there,
Looks like that code redirects you to the child page automatically. Wouldn’t that child page already have the featured image set?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 15, 2019 at 3:48 am #811115Florian
Yes, but I need the parent to have the same featured image as part 1 because the parent page gets displayed in the sidebar together with its thumbnail.
February 15, 2019 at 9:12 am #811435Tom
Lead DeveloperLead DeveloperHow are you displaying the parent page in the sidebar?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 15, 2019 at 9:27 am #811448Florian
A plugin displays a random subset of child pages of /tutorials/android
Sometimes these child pages contain single videos -> the thumbnail is displayed
But sometimes these child pages contain their own child pages (because it’s a video series with multiple parts), in which case the parent doesn’t have a thumbnail on its own.February 15, 2019 at 5:00 pm #811660Tom
Lead DeveloperLead DeveloperIt would likely need to be an option inside the plugin then, unfortunately. You can check with the developer if such a thing is possible.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 16, 2019 at 3:32 am #811848Florian
So a page can not adopt the thumbnail of another page? I really thought that would be possible.
February 16, 2019 at 9:58 am #812210Tom
Lead DeveloperLead DeveloperIt can, but it needs to be coded into the output. If you’re using a plugin to output the post, the code needs to be inserted into the plugin, or there needs to be a filter available. That’s where the plugin author should hopefully be able to help.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 16, 2019 at 10:00 am #812212Florian
Ok thanks, I will contact the plugin author then!
February 16, 2019 at 5:12 pm #812405Tom
Lead DeveloperLead DeveloperNo problem 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.