Setting up Blog page

Home Forums Vozx – Multipurpose WordPress Theme Setting up Blog page

This topic contains 2 replies, has 2 voices, and was last updated by  TouchPointDigital 9 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7092

    TouchPointDigital
    Participant

    Hi, I purchased your theme because I really liked the overall design. But I’ve never had to go through so many steps to set up the demo content, especially the blog page. On every other WordPress site I’ve set up, the blog page layouts are already set up and it’s just a matter of selecting the page you’d like to use for your blog. But your theme is not that simple.

    I have set up the blog category just fine, but I don’t want my blog page to be myurl/category/blog. I just want it to be myurl/blog. Can you please tell me what is the easiest way to achieve this? Thank you.

    #7123

    ab-themes
    Keymaster

    Hi!

    For that you need to change the permalink settings, and edit the functions.php file.

    The core files of wordpress are set to /sitename/category/blog. You need to paste this code at the end of the functions.php file

    add_filter( 'category_rewrite_rules', 'vipx_filter_category_rewrite_rules' );
    function vipx_filter_category_rewrite_rules( $rules ) {
        $categories = get_categories( array( 'hide_empty' => false ) );
     
        if ( is_array( $categories ) && ! empty( $categories ) ) {
            $slugs = array();
            foreach ( $categories as $category ) {
                if ( is_object( $category ) && ! is_wp_error( $category ) ) {
                    if ( 0 == $category->category_parent ) {
                        $slugs[] = $category->slug;
                    } else {
                        $slugs[] = trim( get_category_parents( $category->term_id, false, '/', true ), '/' );
                    }
                }
            }
     
            if ( ! empty( $slugs ) ) {
                $rules = array();
     
                foreach ( $slugs as $slug ) {
                    $rules[ '(' . $slug . ')/feed/(feed|rdf|rss|rss2|atom)?/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
                    $rules[ '(' . $slug . ')/(feed|rdf|rss|rss2|atom)/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
                    $rules[ '(' . $slug . ')(/page/(\d)+/?)?$' ] = 'index.php?category_name=$matches[1]&paged=$matches[3]';
                }
            }
        }
        return $rules;
    }

    And then you’ll need to flush your permalink settings. The way you do that is by going to Settings > Permalinks, and under Common settings select default and save those settings. Then set the permalinks to custom and add /%category%/%postname%/ in the input field. The category base needs to be set to dot ( . ).
    Then save those permalink settings.

    This should do it.

    #7153

    TouchPointDigital
    Participant

    Ok, I’ll try that. Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Setting up Blog page’ is closed to new replies.