php - WP_Query custom TAXONOMY loop ignore custom POST_TYPE -


i developing wordpress based sites on local server. after moving testing server (which production one) custom taxonomy loop breaks. fixed wp_query hack, still looking reason why happend.

local server specs:

runing mac os x 10.8.3

php -v

php 5.3.15 suhosin-patch (cli) (built: aug 28 2012 18:19:13)  copyright (c) 1997-2012 php group zend engine v2.3.0, copyright (c) 1998-2012 zend technologies 

mysql -v

server version: 5.6.11 mysql community server (gpl) 

testing server specs:

linux

phpinfo(); (link burned) http://htcone.htcfans.cz/phpinfo.php

registring taxonomies , post_types (part of functions.php):

/* post_types , taxonomies */  // add post types add_action( 'init', 'add_post_types' );  function add_post_types() {     register_post_type('produkt', array(    'label' => 'produkty','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'produkt'),'query_var' => true,'exclude_from_search' => true,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','revisions','thumbnail','author','page-attributes',),'taxonomies' => array('produkty'),'labels' => array (       'name' => 'produkty',       'singular_name' => 'produkt',       'menu_name' => 'produkty',       'add_new' => 'add produkt',       'add_new_item' => 'add new produkt',       'edit' => 'edit',       'edit_item' => 'edit produkt',       'new_item' => 'new produkt',       'view' => 'view produkt',       'view_item' => 'view produkt',       'search_items' => 'search produkty',       'not_found' => 'no produkty found',       'not_found_in_trash' => 'no produkty found in trash',       'parent' => 'parent produkt',     ),) ); }  // add taxonomies add_action( 'init', 'add_some_taxs' );  function add_some_taxs() {     register_taxonomy('produkty',array (         0 => 'produkt',     ),array( 'hierarchical' => true, 'label' => 'typy produktů','show_ui' => true,'query_var' => true,'rewrite' => array('slug' => 'produkty'),'singular_label' => 'typ produktu') ); } 

template hiearchy:

theme using classic hierarchy structure: http://codex.wordpress.org/template_hierarchy

taxonomy-produkty.php loop - without hack (works on local machine)

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>     <div class="grid-4 product post">         <?php if ( has_post_thumbnail() ) : ?>             <div class="thumb">                 <?php the_post_thumbnail('product-full','class=scale'); ?>             </div>         <?php endif; ?>         <h2 class="title">             <?php the_title(); ?>         </h2>         <div class="content">             <?php the_content(); ?>         </div>     </div> <?php endwhile; endif; ?> 

this hack fixing not working taxonomy-produkty.php loop on testing server:

global $query_string; query_posts($query_string . "&post_type=produkt"); //the loop (code upper) //reset query wp_reset_query(); 

moving local server testing server

mysql

  1. export/inport php admin
  2. customize wp_settings tab

ftp

  1. move whole wordpress
  2. customize db setting in wp_config.php

my question why loop working on local server breaks on testiong one???

if read far you're favorit person:-)

p.s. please excuse bad english.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -