• Resolved sithadro

    (@sithadro)


    If my page is created in Magic Fields 2 plugin (page format, include search) and has assigned custom template, the search result not used search.php.

    Example: https://www.ogrodypoolex.pl/

    When your search the “Mazenna” phrase, wordpress diplay results using search.php (“Mazenna” phrase exists only in “Kontakt” page (standard page format)

    When you search the “ogrody” phrase, wordpress diplay results using custom page template oferta-page.php. (“ogrody” phrase exists on many custom pages which using oferta-page.php template).

    Is it possible to wordpress use search.php template for display resuls from custom page?

    https://www.ads-software.com/extend/plugins/magic-fields-2/

Viewing 1 replies (of 1 total)
  • Thread Starter sithadro

    (@sithadro)

    Problem solved. I modified the file main.php from Magic Fields 2 plugin root directory.

    // Check if the post has a special template
      $template = get_post_meta($post->ID, '_wp_mf_page_template', true);
    
      if (!$template || $template == 'default') {
        return;
      }
    
      $template = TEMPLATEPATH.'/'.$template;
       if (is_search()) {
        return;
      }
    
      if ( $template = apply_filters( 'template_include', $template ) ) {
        include($template);
        die();
      }
      return;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘No control for search results’ is closed to new replies.