Customize blog listings

Community Forums Forums Design Tips and Tricks Customize blog listings

This topic is: not resolved

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  ZeroGravity 1 year, 7 months ago.

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

    ZeroGravity
    Participant
    Post count: 9

    I am applying some custom settings to the blog listings (category, author, tags, date etc.) and I’m sure there must be an easier way to do it. I have created a file blog-settings.php and have included it respective php files. eg. category.php, author.php etc.
    <?php

    /*
     * Settings to customise category pages.
     */

    // Custom blog settings for the Travel Journal
    include_once( ‘blog-settings.php’ );

    genesis();
    ?>
    Any suggestions would be appreciated.


    Darren Burns
    Zero Gravity Web Works

    #29638

    braddalton
    Participant
    Post count: 10243

    There’s a few plugins which help you do this: http://wordpress.org/extend/plugins/post-types-order/

    Can you please be more specific with what you want to do.


    #31189

    ZeroGravity
    Participant
    Post count: 9

    Thanks for your reply Brad, sorry I haven’t go back to you before now. I am trying to use as few plugins as possible. This is the code I have in blog-settings.php.

    [php]/*
    * Settings to customise the blog and archive pages.
    */

    // Add Content (excerpt) for the posts in this Page Template
    remove_action(‘genesis_post_content’, ‘genesis_do_post_content’);
    add_action(‘genesis_post_content’, ‘mmttj_do_post_content’);
    function mmttj_do_post_content() {
    the_excerpt();
    }

    // Add Featured Image for the posts in this Page Template
    remove_action(‘genesis_post_content’, ‘genesis_do_post_image’);
    add_action(‘genesis_post_content’, ‘mmttj_do_post_image’, 7);
    function mmttj_do_post_image() {
    $img = genesis_get_image( array( ‘format’ => ‘html’, ‘size’ => ‘thumbnail’, ‘attr’ => array( ‘class’ => ‘alignleft post-image’ ) ) );
    printf( ‘<a href="%s" title="%s">%s</a>’, get_permalink(), the_title_attribute(‘echo=0′), $img );
    }

    // Add read more link after excerpt
    add_filter(‘the_excerpt’, ‘excerpt_read_more_link’);
    function excerpt_read_more_link($output) {
    global $post;
    return $output . ‘[<a href="'. get_permalink($post->ID) . '">Continue Reading&hellip;</a>]‘;
    }

    // Modify length of post excerpts
    add_filter(‘excerpt_length’, ‘mmttj_excerpt_length’);
    function mmttj_excerpt_length($length) {
    return 100; // pull first 100 words
    }

    // Set page navigation to numeric
    remove_action( ‘genesis_after_endwhile’, ‘genesis_posts_nav’ );
    add_action( ‘genesis_after_endwhile’, ‘mmttj_posts_nav’ );
    function mmttj_posts_nav() {
    genesis_numeric_posts_nav();
    }[/php]


    Darren Burns
    Zero Gravity Web Works

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

You must be logged in to reply to this topic.