Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #17078

    Hello guys.

    I have a page to display one of my categories archives. I wonder if its possible to set a featured image to this Category?

    Thanks!

    Nicolas

    #94096

    Hi!

    Afaik category pages do not support featured images. However maybe plugins like: http://wordpress.org/extend/plugins/dirtysuds-category-thumbnail/ will help you.

    Regards,

    Peter

    #94097

    Hi Nicolas,

    You can try one of these plugins:

    - http://wordpress.org/extend/plugins/categories-images/

    - http://wordpress.org/extend/plugins/category-images-ii/

    I haven’t used this yet but it might be worth a try. These plugins are not yet tested for compatibility with the theme however, these plugins might help you with what you want to achieve, just check your site after activating the plugin and after you have configured it properly, just to ensure it doesn’t conflict with the theme. Just read through the documentation of those plugins and I’m sure you will surely succeed. Hope this is helpful. :)

    Cheers,

    Ismael

    #94098

    Ismael, thanks for your answer!

    I installed the 2nd plugin you listed (Taxonomy Images II), however the feature image for the category is not showing in the archives. I reckon the reason is that my theme is set to not display the feature image on the page/post.

    How can I set my theme to display the feature image on this particular category archives? I don’t want the feature image to be display in other pages/posts.

    By the way, other thing that would solve my problem, is to set a page, to display a category archives below the content, if you know how to do this, I can avoid the step of displaying a feature image for a category.

    Thanks!

    Nicolas

    #94099

    Hi Nicolas,

    Check this link : http://wordpress.org/extend/plugins/category-images-ii/other_notes/

    They have this code that can be used inside archives, this is the code:

    <?php ciii_category_archive_image(); ?>

    Try to insert that code inside wp-contentthemesnewscastarchives.php

    Hope this helps. :)

    Regards,

    Ismael

    #94100

    Ismael,

    I’m afraid it din’t work. Would you pass me the original archive.php because after I tried to modify it, it stops working.

    Thanks!

    Nicolas

    #94101

    Hi Nicolas,

    This is the content of archives.php:

    <?php
    global $more, $k_option;

    $k_option['custom']['bodyclass'] = ""; //<-- Display Sidebar
    // $k_option['custom']['bodyclass'] = "fullwidth"; //<-- Dont display Sidebar

    get_header(); ?>

    <!-- ###################################################################### -->
    <div id="main">
    <!-- ###################################################################### -->

    <div id="content">
    <h2><?php /* If this is a category archive */ if (is_category()) { ?>
    <?php _e('Archive for','newscast'); ?> <?php echo single_cat_title(); ?>

    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <?php _e('Archive for','newscast'); ?> <?php the_time('F jS, Y'); ?>

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <?php _e('Archive for','newscast'); ?> <?php the_time('F, Y'); ?>

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <?php _e('Archive for','newscast'); ?> <?php the_time('Y'); ?>

    <?php /* If this is a search */ } elseif (is_search()) { ?>
    <?php _e('Search Results','newscast'); ?>

    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <?php _e('Author Archive','newscast'); ?>

    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <?php _e('Blog Archives','newscast'); ?>
    <?php } ?></h2>

    <?php
    $fullsized = $k_option['general']['article_appearance'];
    if($paged >= 2)
    {
    if($k_option['general']['article_appearance_sub'] == 1) $fullsized = 0;
    if($k_option['general']['article_appearance_sub'] == 2) $fullsized = 10000;
    if($k_option['general']['article_appearance_sub'] == 3) $fullsized = $k_option['general']['article_appearance'];;
    }

    $smallsized = 1;

    if (have_posts()) :
    while (have_posts()) : the_post();

    // ############################# FULL SIZED POSTS #############################
    if ($fullsized > 0) :

    $preview_image = kriesi_post_thumb($post->ID, array('size'=> array('M'),
    'display_link' => '_prev_image_link',
    'linkurl' => array ('L','_preview_big'),
    'wh' => $k_option['custom']['imgSize']['M']
    ));

    ?>
    <div class="entry <?php if(!$preview_image) echo 'entry-no-pic';?>">
    <?php
    if($preview_image)
    {
    echo '<div class="entry-previewimage rounded preloading_background">';
    echo $preview_image;
    echo '</div>';
    }

    ?>

    <div class="entry-content">
    <h1 class="entry-heading">
    <a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:','newscast')?> <?php the_title(); ?>">
    <?php the_title(); ?>
    </a>
    </h1>

    <div class="entry-head">
    <span class="date ie6fix"><?php the_time('M d, Y') ?></span>
    <span class="comments ie6fix"><?php comments_popup_link(__('No Comments','newscast'), __('1 Comment','newscast'), __('% Comments','newscast')); ?></span>
    <span class="author ie6fix"><?php _e('by','newscast');?> <?php the_author_posts_link(); ?></span>
    </div>

    <div class="entry-text">
    <?php the_excerpt() ?>
    </div>

    <div class="entry-bottom">
    <span class="categories"><?php the_category(', '); ?></span>
    <a href="<?php echo get_permalink() ?>" class="more-link"><?php _e('Read more','newscast'); ?></a>
    </div>
    </div><!--end entry_content-->
    </div><!--end entry -->
    <?php
    $fullsized--;

    else:
    // ############################# SMALL SIZED POSTS #############################
    if($smallsized == 1): echo '<div class="doubleentry">'; endif;
    $smallsized ++;

    $small_prev = kriesi_post_thumb($post->ID, array('size'=> array('S'),
    'display_link' => '_prev_image_link',
    'linkurl' => array ('L','_preview_big'),
    'wh' => $k_option['custom']['imgSize']['S'],
    'img_attr' => array('class'=>'rounded alignleft'),
    'link_attr' => array('class'=>'alignleft preloading_background')
    ));

    ?>
    <div class="entry">
    <div class="entry-content">
    <h1 class="entry-heading">
    <a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:','newscast')?> <?php the_title(); ?>">
    <?php the_title(); ?>
    </a>
    </h1> <div class="entry-head">
    <span class="date ie6fix"><?php the_time('M d, Y') ?></span>
    <span class="comments ie6fix"><?php comments_popup_link(__('No Comments','newscast'), __('1 Comment','newscast'), __('% Comments','newscast')); ?></span>
    </div>

    <div class="entry-text">
    <?php
    if($small_prev) echo $small_prev;
    the_excerpt();
    ?>
    </div>

    <div class="entry-bottom">
    <a href="<?php echo get_permalink() ?>" class="more-link"><?php _e('Read more','newscast'); ?></a>
    </div>
    </div>
    </div>

    <?php
    if($smallsized > 2): echo '</div>'; $smallsized = 1; endif;

    endif; endwhile;
    if($smallsized == 2):echo '</div>'; endif;

    kriesi_pagination();

    else:

    echo'<div class="entry">';
    echo'<h2>'.__('Nothing Found','newscast').'</h2>';
    echo'<p>'.__('Sorry, no posts matched your criteria','newscast').'</p>';
    echo'</div>';

    endif;

    // end content: ?></div>

    <?php
    get_sidebar();

    get_footer();
    ?>

    Try to place the plugin code above this code:

    <?php
    $fullsized = $k_option['general']['article_appearance'];
    if($paged >= 2)

    Regards,

    Ismael

    #94102

    Ismael, thanks for your help mate! You saved my life with the archive.php file!

    I added the plugin code and there is no error breaking the webpage, however the feature image doesn’t show up on the archives page. I think the reason is that my theme has disable the option to show any feature image on post/page. Can I enable the featured image, just to be shown on categories archives?

    Thanks!

    Nicolas

    #94104

    Hi Nicolas,

    Just give it a try. Enable it then give me the link of your pages where you want those images either to hide or show it. Enable it then lets just adjust it via css. :)

    Regards,

    Ismael

    #94105

    What you mind, saynw, to give me the code, that you’ve added exactly in the archive.php? I don’t get it to work. You can use http://pastie.org/ to add your code. Thanks a lot!

    #94106

    Hi,

    @saynw Sure, Try it out. Just have a backup handy of the database and theme.

    Thanks,

    Nick

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

The topic ‘Hot to set featured image for a Category?’ is closed to new replies.