I am using html5blank theme to create a wordpress site but I am having trouble with permalinks. I have a home page and one other page (‘how’), a custom post type (‘what’) with each displaying on the home page and a link to the full article, and I using the default posts to have a blog type section that also shows on the homepage and then click to see full post.

I have a front-page.php, page.php, single-post.php, single-what.php, category.php, author.php, date.php

The problem lies within the theme and the permalinks. Clicking the how page shows a 404 error. Clicking the blog posts shows 404 error but clicking on the category for each post shows the correct page but clicking author or data again shows 404. My permalink structure is /insight/%postname%/

I have tryed saving the permalinks to flush but that didnt work.

I have checking my .htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /brandbiology/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /brandbiology/index.php [L]

# END WordPress

I have made a php page with phpinfo() inside and it shows mod_rewite under loaded modules.

I have disaplyed all plugins and it didn’t work.

It does work however when I change to a wordpress default theme. This naturally point to my theme being the issue, however I’m struggling to think/find what I could have done to cause such an issue.

here is the code for my custom post

function custom_what_post_type() {

// Set UI labels for Custom Post Type
    $labels = array(
        'name'                => _x( 'The What', 'Post Type General Name', 'easyavenues' ),
        'singular_name'       => _x( 'The What', 'Post Type Singular Name', 'easyavenues' ),
        'menu_name'           => __( 'The What', 'easyavenues' ),
        'parent_item_colon'   => __( 'Parent The What', 'easyavenues' ),
        'all_items'           => __( 'All The What Posts', 'easyavenues' ),
        'view_item'           => __( 'View a What Post', 'easyavenues' ),
        'add_new_item'        => __( 'Add a What Post', 'easyavenues' ),
        'add_new'             => __( 'Add New', 'easyavenues' ),
        'edit_item'           => __( 'Edit a What Post', 'easyavenues' ),
        'update_item'         => __( 'Update a What Post', 'easyavenues' ),
        'search_items'        => __( 'Search What Posts', 'easyavenues' ),
        'not_found'           => __( 'Not Found', 'easyavenues' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'easyavenues' ),

// Set other options for Custom Post Type

    $args = array(
        'label'               => __( 'what', 'easyavenues' ),
        'description'         => __( 'The What', 'easyavenues' ),
        'labels'              => $labels,
        // Features this CPT supports in Post Editor
        'supports'            => array( 'title', 'author', 'thumbnail'),
        // You can associate this CPT with a taxonomy or custom taxonomy. 
        'taxonomies'          => array( 'category' ),
        /* A hierarchical CPT is like Pages and can have
        * Parent and child items. A non-hierarchical CPT
        * is like Posts.
        'hierarchical'        => true,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 3,
        'can_export'          => true,
        'has_archive'         => false,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'page',
        'rewrite' => array( 'slug' => '/', 'with_front' => false),

    // Registering your Custom Post Type
    register_post_type( 'what', $args );
add_action( 'init', 'custom_what_post_type', 0 );

Has anyone ran into a problem with either the hmtl5blank template or have any ideas of what I could have done?


Read more here: WordPress permalink problems for custom theme


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: