nawahasan / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
0 stars 0 forks source link

Category post count ok, posts not listing in loop #592

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
After upgrade to WP 4.2.2 / CTM 0.9.8.6-pl, custom post type is counted, but no 
listed. Possibly related to bug 202?

Link:
http://inderoy-naringsforening.no/katalog/bedrift/

Code:

<?php
        $bedriftKat = single_cat_title('', false); // set current category name as a variable   
        $args = array(
          'category_name' => $bedriftKat,
          'post_type' => 'bedrift',
          'showposts' => -1,
          'caller_get_posts' => 1
          );
        $bedrifTall=get_posts($args);
        echo 'count '.count($bedrifTall);
        $komigjen=count($bedrifTall);
    //  echo $komigjen;
            $num_per_column = round($komigjen / 2); // dividing total by columns
        ?>  

    <?php if (have_posts()) : ?>

        <?php /* If this is a category archive */ if (is_category()) { ?>
    <?php if (is_category('bedrift')): ?>
        <h3 class="arc-post-title">Alle <?php single_cat_title(); ?>er</h3>
    <?php else : ?> 
        <h3 class="arc-post-title">Bedrifter på <?php single_cat_title(); ?></h3>
        <?php endif ?>

        <?php } ?>

 <div id="bedrift-kol-v">   <ul>
    <?php while (have_posts()) : the_post(); ?> 

        <?php if ( $telle % $num_per_column == 0 ) : // If the current count is up to it's limit throw in a new column ?>
    </ul>
</div> <div id="bedrift-kol-h">    <ul>
        <?php endif; ?> 
        <li><a href="<?php the_permalink() ?>"><?php the_title() ?></a></li>

        <?php $telle++; // Increment counter ?>

    <?php endwhile; ?>
    </ul></div> 

    <?php else : ?>

        <h2 class="arc-post-title">No posts looping for category <?php single_cat_title(); ?>...</h2>

        <h3 class="arc-src"><span>Du kan prøve et søk:</span></h3>
        <?php get_search_form(); ?>
        <p><a href="<?php echo home_url(); ?>" title="Browse the Home Page">&laquo; Eller gå tilbake til framsida.</a></p><br />
        <h2 class="post-title-color">Profilerte saker:</h2>
        <div class="content-ver-sep"></div><br />
        <?php get_template_part( 'featured-box' ); ?>

    <?php endif; 

/* Restore original Post Data */
wp_reset_postdata();

?>

*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.8.6-pl
WordPress Version: 4.2.2
PHP Version: 5.5.24
MySQL Version: 5.5.42-cll
Server OS: Linux
Language: nb_NO
------------------------ 
ACTIVE PLUGINS: 
 * Add From Server v.3.2.0.3 [http://dd32.id.au/wordpress-plugins/add-from-server/]
 * Advanced Custom Fields v.4.4.2 [http://www.advancedcustomfields.com/]
 * Akismet v.3.1.1 [http://akismet.com/]
 * Alphabetical List v.1.0.3 [http://web-argument.com/wordpress-alphabetical-list-plugin/]
 * Ambrosite Next/Previous Post Link Plus v.2.4 [http://www.ambrosite.com/plugins]
 * Codepress Admin Columns - Pro add-on v.1.0.7 [http://www.codepresshq.com/wordpress-plugins/admin-columns/]
 * Admin Columns v.2.4.3 [http://www.admincolumns.com]
 * Convert Post Types v.1.4 [http://stephanieleary.com/plugins/convert-post-types]
 * CSV Importer v.0.3.8 []
 * Custom Content Type Manager : Advanced Custom Post Types v.0.9.8.6 [https://github.com/craftsmancoding/custom-content-type-manager]
 * Custom Post Display v.1.1 [http://www.crispuno.ca/?p=228]
 * Disable WPAUTOP v.1.0 [http://wordpress.org/extend/plugins/disable-wpautop/]
 * Display Widgets v.2.03 [http://strategy11.com/display-widgets/]
 * Enable Media Replace v.3.0.3 [http://www.mansjonasson.se/enable-media-replace]
 * Error Log Monitor v.1.2.4 [http://w-shadow.com/blog/2012/07/25/error-log-monitor-plugin/]
 * Gravity Forms + Custom Post Types v.3.0.1 [http://themergency.com/plugins/gravity-forms-custom-post-types/]
 * Gravity Forms v.1.9.9 [http://www.gravityforms.com]
 * Gravity Forms Picatcha Add-On v.1.2 [http://www.picatcha.com]
 * Hello Dolly v.1.6 [http://wordpress.org/extend/plugins/hello-dolly/]
 * List category posts v.0.35 [https://github.com/picandocodigo/List-Category-Posts]
 * NIVO slider light v.1.11 [https://www.netaction.de/wordpress-plugin-nivo-slider-light/]
 * NK Google Analytics v.1.4.8 [http://www.marodok.com/nk-google-analytics/]
 * Post Types Order v.1.7.9 [http://www.nsp-code.com]
 * Preserved HTML Editor Markup v.1.5 [http://www.marcuspope.com/wordpress/]
 * Quick Page/Post Redirect Plugin v.5.0.6 [http://www.fischercreativemedia.com/wordpress-plugins/quick-pagepost-redirect-plugin/]
 * Random One Cat Widget v.2.3 [http://brokencrust.com/plugins/random-one-cat-widget/]
 * Reveal IDs v.1.4.5 [http://www.schloebe.de/wordpress/reveal-ids-for-wp-admin-25-plugin/]
 * Simple Image Sizes v.3.0.4 [https://github.com/Rahe/simple-image-sizes]
 * Site Offline or Coming Soon v.1.6.4 [https://wp-ecommerce.net/]
 * TinyMCE Advanced v.4.1.9 [http://www.laptoptips.ca/projects/tinymce-advanced/]
 * wp-filters v.1.0 [http://gobanana.ca/wp-filters]
------------------------ 
CURRENT THEME: Inderoy Naringsforening v.0.1 http://pronomen.no/

Original issue reported on code.google.com by bjo...@gmail.com on 28 May 2015 at 9:36

GoogleCodeExporter commented 8 years ago
I got the same problem. Not sure why

Original comment by soul...@gmail.com on 6 Jun 2015 at 1:38

GoogleCodeExporter commented 8 years ago
I had same issue and now it's fixed. try this.
In wp-content/plugins/custom-content-type-manager/loader.php the filter 
mentioned below might be commented, so if you uncomment this add_filter this 
bug will fix.

// Enable archives for custom post types
    add_filter('request', 'CCTM::request_filter');

Original comment by ke...@zenlo.co.uk on 16 Jul 2015 at 9:39