Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, just a quick note to say that I had also had the same problem – second page of the WP installation and the permalinks page were both blank. I got in contact with my host and they fixed it but why or how this works I have no idea… The response was “I just created an empty phi.ini file and put it on your admin folder.”

    So there you go.

    Sorry Mark I’ve only just been able to get back to this.

    I think the fix for this is going to be something similar to your fix for dreamnoir because the problem is the same but with archive pages instead. I can replicate the problem with a clean install and with the TwentyTen theme:

    1. Start with a clean install of wordpress 3.0.1

    2. At the top of functions.php (in TwentyTen theme) add:

    // Register the book post type and custom taxonomy
    add_action( 'init', 'create_book_types', 0 );
    
    function create_book_types() {
    
    	$labels = array(
    		'name' => 'Books',
    		'singular_name' => 'Book',
    		'add_new' => 'Add New',
    		'add_new_item' => 'Add New Book',
    		'edit_item' => 'Edit Book',
    		'new_item' => 'New Book',
    		'view_item' => 'View Book',
    		'search_items' => 'Search Books',
    		'not_found' => 'No books found',
    		'not_found_in_trash' => 'No books found in Trash',
    		'parent_item_colon' => ''
    	);
    
    	$args = array(
    		'labels' => $labels,
    		'public' => true,
    		'publicly_queryable' => true,
    		'show_ui' => true,
    		'query_var' => true,
    		'rewrite' => array('slug' => 'books'),
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'menu_position' => null,
    		'supports' => array('title', 'editor', 'author', 'custom-fields', 'revisions'),
    	);
    	register_post_type( 'book', $args );
    
    	register_taxonomy('bookcats', 'book' , array( 'label' => 'Book Categories', 'show_ui' => true, 'hierarchical' => true, 'rewrite' => array( 'slug' => 'book-category' ), 'query_var' => true ));
    
    }

    3. At the top of author.php add:

    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    
     query_posts( array( 'post_type' => 'book', 'paged' => $paged, 'posts_per_page' => 1 ) );

    4. Go to the WP admin site, log in as admin.

    5. Change permalinks to ‘Day and name’.

    6. Add three ‘Books’ (with or without a custom category, doesn’t seem to matter).

    7. View the homepage and click ‘admin’ under the first post (so that you can view all posts by admin).

    8. The first page should show correctly, you should be seeing the last of the three books and the pagination link for ‘Older posts’ should be visible BUT if you click on ‘Older posts’ to get to the next page I get a ‘Page not found’ i.e. /author/admin/page/2/ fails.

    Your fix for dreamnoir was to change the slug from plural to singular ‘book’ but that doesn’t work here because the term isn’t in the url – any ideas?

    Thanks again.

    Sorry Mark I didn’t see that replies had gone to two pages! I thought you hadn’t replied.

    No, it’s not based on the twenty ten theme but I do use the get_template_part function quite a bit – but only once in Authors.php, for the loop. I still get the problem though even if I put the loop directly in the page (i.e. remove the get_template_part function).

    And yes I still have the same problem when using default permalinks i.e.

    ?author=1 is fine
    ?author=1&paged=2 is fine
    ?author=1&paged=3 404s

    Thank you for the help!

    Sure – my own custom theme and no plugins.

    Hehe, yes, that worked – partly, but this is a bit strange – this author has 7 ‘adverts’, if I set posts per page (from Reading Settings) to 10 then I correctly get all 7 on the author page. If I change it to 2 per page I get the first two and the next and previous links appear, I then move to page 2 and I get the next two but page three 404s!:

    /author/admin/page/1/ – works
    /author/admin/page/2/ – works
    /author/admin/page/3/ – 404s

    $wp_query->max_num_pages correctly returns 4

    Yes, paging does then work correctly but only lists “post” post types not my custom post type.

    Hi Mark,

    Thanks. I’m afraid the site is not public though but the permalink structure is: /%year%/%monthnum%/%postname%/ and both category and tag bases are blank (default).

    Hi,

    Not sure if this is related, but I’m having problems getting pagination working on the authors page. The complication may be that I need the author’s page to list only the custom post type ‘advert’.

    So, in author.php I have:

    if(isset($_GET['author_name']))
        $curauth = get_user_by('slug', $author_name);
    else
        $curauth = get_userdata(intval($author));
    
    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    
    query_posts( array( "post_type" => "advert", "paged" => $paged, "author" => $curauth->ID ) );

    In the page ‘next_posts_link()’ returns /author/admin/page/2 but this link 404s. With permalinks turned off the url ?author=1&paged=2 also returns 404.

    Custom post type registered with:

    $args = array(
    		'labels' => $labels,
    		'public' => true,
    		'publicly_queryable' => true,
    		'show_ui' => true,
    		'query_var' => true,
    		'rewrite' => array('slug' => 'ads'),
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'menu_position' => null,
    		'supports' => array('title', 'editor', 'author', 'custom-fields', 'revisions'),
    	); 
    
    register_post_type( 'advert', $args );

    Any ideas greatly appreciated!

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