The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
|
Pulling child page info - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: Pulling child page info (/showthread.php?tid=7544) |
Pulling child page info - alex809 - 2015-09-13 Hello, So i have successfully used this: http://get-simple.info/forums/showthread.php?tid=6629 In order to pull page content and then i created a function to pull the page title as well Code: function getPageTitle($page,$field='title'){ and i can now use: <?php getPageTitle($child); ?> So, now all i need to do is pull the date for the child pages. However, i can't figure out how to do a function to be able to pull the child page date because the date function is created in theme_functions and not caching_functions. So how would i go about pulling the child pages correct date? Currently i can either display the main pages date or what is currently displaying. If someone could help me in pulling the child pages date without any plugins that would be great Since i don't want to have to go through and manually add pages to the file. I want it done automatically so this is why I'm doing it this way. Thanks - Alex RE: Pulling child page info - DimaYakovlev - 2015-09-17 (2015-09-13, 06:44:25)alex809 Wrote: Hello, See this post http://get-simple.info/forums/showthread.php?tid=6629&pid=46969#pid46969 Use getPageField function to get needed fields from child pages. RE: Pulling child page info - alex809 - 2015-09-19 (2015-09-17, 17:16:03)DimaYakovlev Wrote: See this post http://get-simple.info/forums/showthread.php?tid=6629&pid=46969#pid46969 I got the code from that thread.. http://get-simple.info/forums/showthread.php?tid=6629&pid=46971#pid46971 That isn't gonna help me pull the child pages date. I already got the child page titles and content. As you can see. PHP Code: <?php getPageField($child, 'date'); ?> Returns nothing: RE: Pulling child page info - shawn_a - 2015-09-19 its pubDate RE: Pulling child page info - alex809 - 2015-09-19 (2015-09-19, 03:04:31)shawn_a Wrote: its pubDate Ok, It works Now how do i get it to display properly? Lol PHP Code: <div class="published-date"><?php getPageField($child, 'pubDate'); ?></a></div> RE: Pulling child page info - Carlos - 2015-09-19 PHP Code: <?php echo date('d-m-Y', strtotime(returnPageField($child, 'pubDate'))); ?> RE: Pulling child page info - alex809 - 2015-09-21 (2015-09-19, 05:54:45)Carlos Wrote: Thanks. I simply switched it to PHP Code: <?php echo date('F jS, Y', strtotime(returnPageField($child, 'pubDate'))); ?> Actually displays the proper date now |