Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18338

    Im looking at setting up multiple pages much like the blog for news, notices etc however I am unable to use ‘blog’ as this mixes the news and notices together, is there any way of copying the template and creating a new template within the theme to do this?

    n.b. I am a coder so if need to mess with files i can do.

    #99080

    Or a way to have a post category that is not picked up by the ‘blog’ theme.

    #99082

    Hi,

    Use the Template Builder, insert the Blog element, choose the category.

    Regards,

    Ismael

    #99083

    Hi Ismael,

    I have done this but I am after it on our frontpage, i am using it in the columns then ‘Latest Blog Entries’ I was wondering whether or not this option could be done also via category OR have a tutorial on creating a custom post type and adding that to the link.

    Thanks

    #99084

    Hi,

    It would be easiest to just add another taxonomy , or another 20 taxonomies and attach them to the post, they will not be picked up by the standard category. thought you have to call it something other than category ofcourse. Here, just drop it somewhere inside functions.php file, and you will have Kategories for posts.

    // registration code for kategory taxonomy
    function register_kategory_tax() {
    $labels = array(
    'name'=> _x( 'Kategories', 'taxonomy general name' ),
    'singular_name'=> _x( 'Kategory', 'taxonomy singular name' ),
    'add_new'=> _x( 'Add New Kategory', 'Kategory'),
    'add_new_item'=> __( 'Add New Kategory' ),
    'edit_item'=> __( 'Edit Kategory' ),
    'new_item'=> __( 'New Kategory' ),
    'view_item'=> __( 'View Kategory' ),
    'search_items'=> __( 'Search Kategories' ),
    'not_found'=> __( 'No Kategory found' ),
    'not_found_in_trash' => __( 'No Kategory found in Trash' ),
    );
    $pages = array('post');
    $args = array(
    'labels'=> $labels,
    'singular_label'=> __('Kategory'),
    'public'=> true,
    'show_ui'=> true,
    'hierarchical'=> true,
    'show_tagcloud'=> true,
    'show_in_nav_menus' => true,
    'rewrite'=> array('slug' => 'kategory', 'with_front' => false ),
    );
    register_taxonomy('kategory', $pages, $args);
    }
    add_action('init', 'register_kategory_tax');

    and you can create an empty file and drop it into the root directory called taxonomy-kategory.php and put the following code into it

    <?php
    global $avia_config, $more;
    /*
    * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    */
    get_header();
    $description = is_tag() ? tag_description() : category_description();
    echo avia_title(array('title' =>
    avia_which_archive(), 'subtitle' => $description)); ?>
    <div class='container_wrap main_color <?php avia_layout_class( ' main' ); ?>
    '>
    <div class='container template-blog template-overlap'>
    <div class='content <?php avia_layout_class( ' content' ); ?>
    units'> <?php
    /* Run the loop to output the posts.
    * If you want to overload this in a child theme then include a file
    * called loop-index.php and that will be used instead.
    */
    $loop_file = 'index';
    $avia_config['currently_viewing'] = 'blog';
    if(is_tax('sermon_categories'))
    {
    $loop_file = 'sermon';
    $avia_config['currently_viewing'] = 'sermon';
    }
    $more = 0;
    get_template_part( 'includes/loop', $loop_file );
    ?>
    <!--end content-->
    </div>
    <?php
    //get the sidebar
    get_sidebar();
    ?>
    </div>
    <!--end container-->
    <?php get_footer(); ?>

    I haven’t tried the taxonomy page , so not sure what it will do, but the first part of the code will work for sure.

    Please let us know how it turned out,

    Thanks,

    Nick

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

The topic ‘New template page like the 'Blog'’ is closed to new replies.