• First…. Thank you SO much to all the people who have solved problems here previously. Thanks to this great archive, which fortunately turns up in Google search results, I have solved *countless* bugs on my site. So if you have ever helped someone here, THANK YOU from the *legions* of us who have silently read (and benefited from) it later.

    The bug that finally prompts me to write for help:

    I have successfully (after days of work) customized my category.php to reflect a list of the respective category’s posts, using rpwe and a call-category code. See the successful page here.

    Problem:
    Although it works correctly on the page referenced above, for all other category pages the list of recent posts returns a blank list. See the unsuccessful page here.

    Controls:
    The correct cat always displays in the page title – so the cat is successfully passed to the category.php.
    List of recent posts works on one, but no other, category.
    Yes, I am testing by clicking only on categories that have at least one post.
    Yes, I have tried every variation of “get cat id” and object id, etc, ad nauseum. You can see each commented-out trial-block in my code posted below.
    I have tried moving all code into the header section. No difference.

    Question:
    Anyone know why (only) rpwe is not picking up the current category?

    THANK YOU!

    get_header(); ?>
    
    <div id="primary" class="content-area">
    
    	<header class="page-header">
    		<?php
    			the_archive_title( '<h1 class="page-title-cat">', '</h1>' );
    			the_archive_description( '<div class="taxonomy-description-cat">', '</div>' );
    		?>
    	</header><!-- .page-header -->
    
    	<div class="rpwe_cat">
    		<div class="rpwe_cat_title">All Posts in this Category:</div>
    
    		<!-- START - SERIES OF VARIATIONS TO MAKE (CURRENT ARCHIVE) RECENT POST LIST DISPLAY -->
    		<!-- START - SERIES OF VARIATIONS TO MAKE (CURRENT ARCHIVE) RECENT POST LIST DISPLAY --> 
    
    		<?php
    			//$middle1 = get_query_var('cat');
    			//echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle1 . '" styles_default="false" cssID="fvbig"]');
    		?>
    		<?php
    			$middle2 = get_queried_object_id();
    			echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle2 . '" styles_default="false" cssID="fvbig"]');
    		?>
    		<?php
    			//$middle3 = get_the_category();
    			//echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle3 . '" styles_default="false" cssID="fvbig"]');
    		?>
    		<?php
    			//$middle4 = get_cat_ID();
    			//echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle4 . '" styles_default="false" cssID="fvbig"]');
    		?>
    		<?php
    			//$middle5 = the_archive_id();
    			//echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle5 . '" styles_default="false" cssID="fvbig"]');
    		?>
    		<?php
    			//$middle6 = get_the_archive_id();
    			//echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle6 . '" styles_default="false" cssID="fvbig"]');
    		?>
    		<?php
    			//$middle7 = get_the_cat_id();
    			//echo do_shortcode('[rpwe limit="25" thumb="false" cat="' . $middle7 . '" styles_default="false" cssID="fvbig"]');
    		?>
    
    		<!-- END - SERIES OF VARIATIONS TO MAKE (CURRENT ARCHIVE) RECENT POST LIST DISPLAY -->
    		<!-- END - SERIES OF VARIATIONS TO MAKE (CURRENT ARCHIVE) RECENT POST LIST DISPLAY --> 
    
    	</div>
    
    </div><!-- .content-area -->

    https://www.ads-software.com/plugins/recent-posts-widget-extended/

  • The topic ‘rpwe not picking up cat id from category.php’ is closed to new replies.