wordpress短代码不适用于子页面

时间:2014-05-19 10:48:44

标签: php wordpress filter

由于某种原因,我的wordpress主题不是过滤/翻译短代码...这是主题的相关代码

    <?PHP

   $my_wp_query  = new WP_Query();
   $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));

   $children = get_page_children(get_the_ID(), $all_wp_pages);
   $children = (array)$children;

    function object_to_array($object) {
    if(is_array($object) OR is_object($object)) {
    $result = array();
    foreach($object as $key => $value) {
    $result[$key] = object_to_array($value);
    }
    return $result;
    }
    return $object;
    }
    $children = object_to_array($children);

    function sortByOrder($a, $b) {
    return $a['menu_order'] - $b['menu_order'];
    }

    usort($children, 'sortByOrder');

    ?>

如何过滤数组$ children中的内容,以便wordpress中的短代码被“翻译”?

0 个答案:

没有答案