WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Static Image on front page. Not thumb etc. (8 posts)

  1. branchwhipped
    Member
    Posted 4 years ago #

    URL: http://www.branchwhipped.com

    I want to be able to place and image (png or jpeg) below my features content gallery with the rotating images, and above the two columns labled "featured" and "giveaways". Ideally it would be about 600px wide and 30 px high, and also have it be linked to a URL of a static page on my site.... Is this possible?

    Thanks for any help, I've searched the forums with no luck. i tried it on my own with no results, only messed up the layout of the site.

  2. giant slayer
    Member
    Posted 4 years ago #

    are you wanting random images per page load? or are you wanting a slideshow type behavior which cycles through images after a few seconds?

  3. branchwhipped
    Member
    Posted 4 years ago #

    I want to be able to embed an image in my home page, on top or below the columns, and have that image stay there, not rotate etc. as if it were part of the theme. Then I want that same image linked to a page of my site.

    for example a page on my site is Giveaways. I want a button/image on the home page that you can design/customize that is clickable that sends the user to the giveaway page. If that makes sense and is possible that would be AWESOME. Any help is greatly appreciated.

  4. giant slayer
    Member
    Posted 4 years ago #

    Yeah, I think it is quite possible. Try this in your main index template (index.php)

    <?php if (is_home()) { ?>
    	<a href=giveaways.php><div id=giveaways></div></A>
    <?php } ?>

    Then style the div with posision, width, height, and have the image as the background of the div. For example, you could have something similar to this

    #giveaways {
    	height: 100px;
    	width: 100px;
    	float: left;
    	background: url(images/giveaway.gif);
    }
  5. branchwhipped
    Member
    Posted 4 years ago #

    giant slayer,
    Thanks for the tips. I'll try that and let you know how it goes.

  6. branchwhipped
    Member
    Posted 4 years ago #

    Giant Slayer,
    Wow PHP eludes me.

    I tried these combination of what you suggested above in the (index.php)

    I tried what you suggested:

    <?php if (is_home()) { ?>
    	<a href=giveaways.php><div id=giveaways></div></A>
    <?php } ?>

    and
    <div id="giveaways">
    and
    <?php get_sidebar(); ?>

    Then I'm assuming I put the lower code you posted in the "style.css" template file. I tried what you posted: (with variation)

    #giveaways {
    	height: 50px;
    	width: 300px;
    	float: left;
    	background: url(images/test.png);
    }

    And then I tried this as well as my test image is 300px x 50px (test.png)

    #giveaways {
            float: left;
            width: 300px;
    	height: 50px;
    	margin: 0px;
    	padding: 0px;
    	background: url(images/test.png);
    }

    Maybe I placed the code in the wrong place in the template files altogether...? I'm just happy to have a place to start, the forum I purchased the theme from is not helpful. Thanks

  7. giant slayer
    Member
    Posted 4 years ago #

    Where do you want the image to be?

    I notice in your source code that you have a div with a class of "homepageleft" with a width of 336px. For the dimensions you mentioned, you probably want to put that php code section just after the homepageleft and just before the <h3>Feature</h3>.

    If your sidebar is on the left, then you will need to put it in the sidebar.php, but if this is the main content, then you will need to put it in the index.php. (I think, not knowing what your php files look like)

    This should place the image just above the feature column on the left hand side.

  8. branchwhipped
    Member
    Posted 4 years ago #

    giant slayer,
    Thanks for you help

    http://www.branchehipped.com

    Put this into into my style.css theme file:

    #giveaways {
            background: #CCCCCC;
            float: left;
            width: 610px;
    	height: 50px;
    	margin: 0px;
    	padding: 0px;
         	background: url(images/dark/giveaways.png);
    }

    and what you posted above into my home.php file not the index.php

    <?php if (is_home()) { ?>
    	<a href=giveaways.php><div id=giveaways></div></A>
    <?php } ?>

    Thanks for your help I fugured it out with a test image, not to just design it better before it goes live.
    Thanks A LOT

Topic Closed

This topic has been closed to new replies.

About this Topic