Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter chatotek

    (@chatotek)

    Hi, thanks for your reply. If anyone else is interested my workaround (quick but probably not very efficient) was to not use in_same_parent and instead use the in_pages option to which I passed a comma seperated list generated with the get_pages function with child_of set to the top-most post ancestor.

    Thread Starter chatotek

    (@chatotek)

    I think I might have made my question a bit complicated by giving so much information. I think I can solve the problem on my own if someone can explain to me if it’s possible to get something like this to work:

    <?php
    $parent_page = $post->ID;
    $pages = get_pages('child_of='.$parent_page.'');
    $single_line = implode("OR", $pages);
    echo $single_line;
    ?>

    Echoing $single_line would output “ID1 OR ID2 OR ID3” etc. where ID1 is the ID of child one.

    Thread Starter chatotek

    (@chatotek)

    Thanks so much, the idea to echo the $sql part was genius! Just in case anyone’s reading this the only problem I had then was trimming the white space that was appearing in front of the $mytitle when the variable was generated. I added

    function af_titledespacer($title) {
    	return trim($title);
    }
    
    add_filter('wp_title', 'af_titledespacer');

    to the functions file and that solved the problem.
    Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)