Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Same issue here – running 2.6.3, removed the comments in quicktag.js as shown, the code shown in the FAQ within editor_plugin.js has changed, and the WP_Page button is shown there… But it’s sure not showing up in the visual editor! Help?

    Here’s the modified plugin (this is the full code) which will force subcategory pages and individual subcategory posts to assume the template of the parent category. (Man, I can’t believe I missed this one the first time though…)

    <?php
    /*
    Plugin Name: Force Category Template
    Plugin URI: http://txfx.net/code/wordpress/force-category-template/
    Description:
    Author: Mark Jaquith
    Version: 0.1
    Author URI: http://txfx.net/
    */
    
    /*
    Edited to force category pages and single posts to assume the parent category template in the absence of a unique child-category template by Jason, Screaming Light Studios, August 2008. */ 
    
    /* GPL goes here */
    
    function txfx_force_category_template() {
    
       if ( is_category() || is_single() || !is_404() )  // sort for single posts or categories, but under no circumstances do this for the 404 page!
       {
    	global $posts, $post;
    
    	$post = $posts[0];
    	$categories = get_the_category($post->ID);
    
    	if ( !count($categories) ) return; // no category with which to work
    
    	foreach ( $categories as $category ) {
    		if ( file_exists(TEMPLATEPATH . "/category-" . $category->cat_ID . '.php') ) {
    			include(TEMPLATEPATH . "/category-" . $category->cat_ID . '.php');
                            exit; }
                elseif ( file_exists(TEMPLATEPATH . "/category-" . $category->category_parent . '.php') ) {
    			include(TEMPLATEPATH . "/category-" . $category->category_parent . '.php');
    			exit; }
    	}
       }
       else return;
    }
    
    add_action('template_redirect', 'txfx_force_category_template');
    ?>

    cSoul

    Here’s a way to make single posts display in the parent category template. I used the Force Category Template plugin, but modified it as follows:

    foreach ( $categories as $category ) {
    		if ( file_exists(TEMPLATEPATH . "/category-" . $category->cat_ID . '.php') ) {
    			include(TEMPLATEPATH . "/category-" . $category->cat_ID . '.php');
                            exit; }
                elseif ( file_exists(TEMPLATEPATH . "/category-" . $category->category_parent . '.php') ) {
    			include(TEMPLATEPATH . "/category-" . $category->category_parent . '.php');
    			exit; }
    	}

    The if section is from the original plugin; the elseif section is the modification.

    Now all I have to do is figure out some similar way to format the category page. I suspect that will mean adding a similar switch to the template hierarchy code in wordpress, if I can find it, or figuring out how to write my own plugin.

    Best of luck,

    cSoul

    Take a look at how I pulled this off:

    http://screaminglight.com/projects/technical/wordpress-blog-posts-on-pages/

    Lots of pieces have to come together, but it’s completely doable. Shoot me an email if I was unclear, and good luck!

    cSoul <csoul@SPAMFREEscreaminglight.com> – remove the capital letters

    I’m having the same issue in 2.5.1

    Permalink structure /%category%/%postname%/

    /page/2/ leads to a 404 error *unless* the front page and the second page show the same number of posts (3, in this case.) That, need I say, is annoying as heck. I’d *much* rather show 3 on the front page and 10 on the rest of the pages.

    Pagination worked fine under the default permalink structure. I’ve completely rebuilt htaccess and mucked about with all the other suggestions I could find, with no luck.

    My major question is the same as gimperdaniel’s: WHY is it doing this? My minor question is how do I make it stop?

    EDIT:
    Could this have something to do with a mismatch between “showposts=3” in the index.php template and a “Pages show at most 10” setting? Removing the “showposts” setting from the index.php file also seems to fix it.

    EDIT (again):
    Adding a conditional ( is_front_page() && !is_paged() ) to the query string, with the front page using “showposts=3” and everything else omitting the restriction, doesn’t seem to solve the problem either.

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