WordPress.org

Ready to get started?Download WordPress

Forums

How to Include Banner Image on Just One Single Page (37 posts)

  1. Weeniebaste
    Member
    Posted 2 years ago #

    Hello everyone. I need help resolving a problem that I'm sure is simple, but I can't figure out for the life of me. I'm new to writing WordPress code, so that's probably why I'm stumped.

    I want to include a banner image on just one single page. This particular page on my WordPress site is a blog (the rest of the pages on my site are non-blog, regular and straightforward web pages). I would like to include a banner on that blog page, but make sure it doesn't appear on any other page. I have tried following the suggestions of other questions/responses on the forum, but for some reason I'm not getting something and/or I'm doing something wrong. I need to know:

    - what code I should use to get that image banner on just one page and use it as a header
    - in what php template I should place that code
    - where in the php the code should go

    Along with this, how can I remove other header information (name of site, subtitle) on that one single blog page to where there is only the banner image at the top of that one page.

    Remember, I'm new to all of this, so I would appreciate clear and careful suggestions for a newbie.

    Much thanks!

  2. Ryan Yu
    Member
    Posted 2 years ago #

    Hey Weeniebaste,

    Can you post the blog url that you want to add the banner in?
    So just to make sure, you want to display the banner only on ONE page right?

  3. Weeniebaste
    Member
    Posted 2 years ago #

    Hi Geeksfolder. My website is http://derekroyal.com, and the page I want the banner on is http://www.derekroyal.com/?page_id=92. I'm using the Mazeld theme, if that makes any difference. And yes, I only want to display that image banner on only that one page.

    Much thanks!

  4. Ryan Yu
    Member
    Posted 2 years ago #

    As Mazeld theme is the child theme of TweentyTen you will have to get the page.php file from TweentyTen.

    Log in your FTP software (like FileZilla) and go to wp-content/themes/twentyten.
    Download page.php and open it up in the preferred text editor.

    Add this code in the area you want to put the banner ad.

    <?php
    if (is_page(92)) {
    ?>
    YOUR BANNER AD CODE GOES HERE
    <?php
    }
    ?>

    Upload the page.php to your Mazeld theme located in wp-content/themes/mazeld

    If you are not sure all the process above, let me know exactly where you want to add your banner in. Also post your banner ad code. I will create the page.php file for you.

  5. Weeniebaste
    Member
    Posted 2 years ago #

    Much thanks again, Geeksfolder. I can ftp the file and then upload it to the Mazeld folder, no problem. But in terms of the banner code, what do I put? Sorry to sound ignorant, but this kind of coding is new to me. I know HTML, but working in php files, I'm a newbie.

    FYI, the image banner I want to put up on that page, ID 92, is at http://www.derekroyal.com/wp-content/themes/mazeld/blogheader.jpg

    Ideally, I'd like that to be the only header on the page, without the name of the site (my name), the subtitle ("Making the World Safe for Things and Stuff") and the rotating image that appears on the right next to the title.

  6. Ryan Yu
    Member
    Posted 2 years ago #

    I see, so you want to have the header graphic on the specific page, is that right?

    Then what you need to do is,
    go to Appearance > Editor
    and click Header link in the right side bar
    and replace this section (from line 38 to line 53)

    <div id="header">
    ...
    </div><!-- #header -->

    to the code below.

    http://pastebin.com/DU1TkdYe

    Please note your new header graphic is smaller than the total width of the header area, so I centered it.

  7. Weeniebaste
    Member
    Posted 2 years ago #

    Thanks again, Geeksfolder. I did as you suggested, editing the header.php file by making the appropriate substitutes, but it didn't work. Am I doing something wrong?

  8. Ryan Yu
    Member
    Posted 2 years ago #

    Can you post your header.php code using pastebin.com please?
    I will take a look.

  9. Weeniebaste
    Member
    Posted 2 years ago #

    Geeksfolder - I've posted both my header.php file (which has the changes you recommended) and a file named header_backup.php (which is the original header.php before any changes). You can find them at:

    header.php: http://pastebin.com/84Xhd9a9

    header_backup.php: http://pastebin.com/JUuGvv0g

    Again, much thanks for all of your help on this.

  10. Ryan Yu
    Member
    Posted 2 years ago #

    I see, the page you want to add the new header graphic to is not a static page, but the index of blog entries...

    In that case, change

    <?php if(is_page(92)) { ?>

    to

    <?php if(is_home()) { ?>

    from the code I gave you, it should work.

    Please let me know if it doesn't still work.

  11. Weeniebaste
    Member
    Posted 2 years ago #

    This is great, Geeksfolder. It worked. I really do appreciate all of your help with this. One other thing: even though I wanted to get rid of the title and substitute it with the image banner, I wanted to retain the menu bar that comes right under the title/subtitle on all the other pages (so readers can get from one page to another easily). What code should include to restore the menu to that one blog page, ID 92?

    Thanks again!

  12. Ryan Yu
    Member
    Posted 2 years ago #

    Hey Weeniebaste,

    This one should work :)
    http://pastebin.com/T3hyF1nw

  13. Weeniebaste
    Member
    Posted 2 years ago #

    That did it. Much thanks, Geeksfolder! You da man!

  14. Weeniebaste
    Member
    Posted 2 years ago #

    Check out the blog now, particularly the entry I just put up today: http://www.derekroyal.com/?p=865.

  15. Ryan Yu
    Member
    Posted 2 years ago #

    Awesome, let me know if you have any other problems!

    BTW you've got some interesting articles on your blog :)

  16. Weeniebaste
    Member
    Posted 2 years ago #

    Thanks for the good words, Geeksfolder. Check out my other blog, the Gallery of the Absurd: http://galleryofabsurd.com. Less serious, more strange.

  17. theshann
    Member
    Posted 2 years ago #

    Geeksfolder, I am trying to do the same thing as Weeniebaste. My site in not on the web yet but I am self hosting my site with bitnami while I am creating it. Can you help me out. I used your suggestion but it shifted my site losing the right column. Thanks!

  18. Ryan Yu
    Member
    Posted 2 years ago #

    Hey theshann,

    Sure I will help you, but I need to see your site and code.
    Can you upload your site on your server temporarily
    and send me the link?

  19. theshann
    Member
    Posted 2 years ago #

    Yes, I have to sign up for a server first. Thank you very much. I will start to work on that now.

  20. theshann
    Member
    Posted 2 years ago #

    Geeksfolder

    I have uploaded my site and it is http://www.nostalgiagroup.net

    The banner I want to put on the post page is:

    http://nostalgiagroup.net/wp-content/uploads/2012/01/NEWS-BANNER.jpg

    Thanks for offering your help.

  21. Ryan Yu
    Member
    Posted 2 years ago #

    Hey theshann,

    Just to make sure...
    so you want to display the new banner only on the blog page.
    Is that right?
    Then can you post your header.php code in pastebin.com?
    I will take a look at the code and modify it for you.

  22. theshann
    Member
    Posted 2 years ago #

    Yes I do want to display the banner only on the blog page.

    I'm sorry but I can't find the header.php code but I have seen it before. would you like me to give you a temporary log in to my sight?

  23. Ryan Yu
    Member
    Posted 2 years ago #

    Yep, that will do.

    Please send me the login details through here and I will take a look.
    http://geeksfolder.com/contact-form/

  24. theshann
    Member
    Posted 2 years ago #

    Hi geeksfolder,

    I sent you the login information for my site. I have been looking at your site and it looks great and works very well. Did you use wordpress. I like your contact page. Also, my blog page is the news button.

    Thank you very much for your help.

    Shann

  25. Ryan Yu
    Member
    Posted 2 years ago #

    Hey theshann,

    Oh probably you might have missed my another email.
    As I need to modify your files, I need to grant the admin access to your backend.

    Currently my account you have set up is a subscriber.
    Please change the level to admin and let me know.

    Thanks!

  26. theshann
    Member
    Posted 2 years ago #

    I set you up as an admin.

    Thank you for your help.

    Shann

  27. Ryan Yu
    Member
    Posted 2 years ago #

    Hey theshann,

    It has been updated so the new header graphic will appear on the blog pages.
    http://nostalgiagroup.net/2012/01/04/hello-world/
    http://nostalgiagroup.net/

    Feel free to let me know if you have any further questions.

  28. gmonk
    Member
    Posted 2 years ago #

    Hmmm... I wonder if I could interject on this topic?

    Here's the case:

    I have kind of a photoblog. A template that I'm creating. On the home.php page, I have kind of a grid thing going on with a featured image for each post. When someone clicks that post or image, I was able to display the featured image on one part of the single.php page. What I'd super like to do is add an additional image that also pertains to that post.

    I tried to just add an image to the actual post, you know, "insert in to post". But that didn't work.

    Any suggestions out there?

  29. Ryan Yu
    Member
    Posted 2 years ago #

    Hey gmonk,

    Can I see your webpage please?
    I would have a better idea :)

  30. gmonk
    Member
    Posted 2 years ago #

    My website is hosted locally. Would I just be able to paste the code to you or how would you like to see it?

Topic Closed

This topic has been closed to new replies.

About this Topic