I need to fix this template code so it sends a visitor a php header with random child page location.
<?php
/*
Template Name: Redirect to Random Sub
*/
echo wp_list_pages('child_of='.$post->ID.'&title_li=');
/* header('Location: '); */
?>
Thx.
I need to fix this template code so it sends a visitor a php header with random child page location.
<?php
/*
Template Name: Redirect to Random Sub
*/
echo wp_list_pages('child_of='.$post->ID.'&title_li=');
/* header('Location: '); */
?>
Thx.
It doesn't have the ability to limit itself to child pages, but the Redirection plugin can do random redirects.
I just need a tag or function that can create an array with urls from a page's children.. does this question even make sense ?
Might try this untested code to get an array of IDs for pages with parents
$pageswithparents = $wpdb->get_results("SELECT ID
FROM $wpdb->posts
WHERE post_type = 'page'
AND post_parent > 0");
Gleaned from http://codex.wordpress.org/Function_Reference/wpdb_Class
This topic has been closed to new replies.