Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #395

    Hello,

    Would it be possible to have the blog page not have a title and instead an image I supplied? http://www.theresolved.com/?cat=12/ So for example where the word “Blog” is at the top of the entries…instead have an image there. If so, what file would I edit and where in the file would I put the image?

    Thanks.

    #31182

    Sure, open up archive.php and find this code:

    <h2><?php /* If this is a category archive */ if (is_category()) { ?>
    Archive for <?php echo single_cat_title(); ?>

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

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

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

    <?php /* If this is a search */ } elseif (is_search()) { ?>
    Search Results

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

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

    Change it to this:

    <h2><?php if (is_category('blog') { ?>
    <img src="MY-IMAGE.JPG" alt="MY-DESCRIPTION-OF-THIS-IMAGE" />

    <?php /* If this is a category archive */ elseif (is_category() && !is_category('blog')) { ?>
    Archive for <?php echo single_cat_title(); ?>

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

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

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

    <?php /* If this is a search */ } elseif (is_search()) { ?>
    Search Results

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

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

    #31183

    I tried what you put above and I got this error:

    Parse error: syntax error, unexpected ‘{‘ in /var/www/vhosts/theresolved.com/httpdocs/wp-content/themes/display/archive.php on line 8

    #31184

    Sorry! Made a mistake with the code, try this instead:

    <h2><?php if (is_category('blog') { ?>
    <img src="MY-IMAGE.JPG" alt="MY-DESCRIPTION-OF-THIS-IMAGE" />

    <?php /* If this is a category archive */ } elseif (is_category() && !is_category('blog')) { ?>
    Archive for <?php echo single_cat_title(); ?>

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

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

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

    <?php /* If this is a search */ } elseif (is_search()) { ?>
    Search Results

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

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

    #31185

    Tried that one too. Got this error message:

    Parse error: syntax error, unexpected ‘{‘ in /var/www/vhosts/theresolved.com/httpdocs/wp-content/themes/display/archive.php on line 7

    #31186

    James forgot a “)” in the first line and so you get a syntax error.

    Here is the correct code:

    <h2><?php if (is_category('blog')) { ?>
    <img src="MY-IMAGE.JPG" alt="MY-DESCRIPTION-OF-THIS-IMAGE" />

    <?php /* If this is a category archive */ } elseif (is_category() && !is_category('blog')) { ?>
    Archive for <?php echo single_cat_title(); ?>

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

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

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

    <?php /* If this is a search */ } elseif (is_search()) { ?>
    Search Results

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

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

    #31187

    Thx. That did it!

    #31188

    Hi!

    Sorry guys, thanks @Dude for spotting this!

    Regards,

    James

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

The topic ‘Tweek Blog Page’ is closed to new replies.