Forum Replies Created

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

    (@tommyae)

    Yea, of course, just paste this function into includes/theme.inc at line 99 in v1.6, below the preprocess for rows:

    /*
     * Preprocess query_display_syle to allow field styles to define their own default path
     */
    function theme_query_display_style_preprocess($template)
    {
      $all_styles = qw_all_styles();
      // make sure we know what style to use
      if(isset($all_styles[$template['arguments']['style']]))
      {
        // get the specific style
        $style = $all_styles[$template['arguments']['style']];
        // set this template's default path to the style's default path
        if (!empty($style['default_path'])){
          $template['default_path'] = $style['default_path'];
        }
      }
      return $template;
    }
    Thread Starter tommyae

    (@tommyae)

    Ok I found the problem. There’s no preprocess function set up for display styles, only row styles. I just copied the preprocess function and renamed it, now the template file gets loaded.

    Hey,

    I’m using the 1.6 beta version now, had the same problem so I looked into it. Turns out that the nav-menu-template.php wants to know if our page has any ancestors. Adding this line in query-pages.inc at line 242 fixes the problem:
    $post->ancestors = get_ancestors($post->ID, $post->post_type);
    But since this is a faked page, perhaps it’s better to just do
    $post->ancestors = array();
    since we know this page won’t have any ancestors. Either way, this solved it for me.

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