• Does anyone know if it is possible to have a different header image display on, say my about page, than the main page? And/or how to do this?

    Thank you.

Viewing 15 replies - 1 through 15 (of 21 total)
  • <?php if(is_page('About')) : ?>
    do about page specific code
    <?php else : ?>
    do normal stuff
    <?php endif;?>

    Would need to see your existing code to be more specific…

    header.php more then likely..

    If posting code, please do so inside backticks as indicated in the post box or use a pastebin…
    https://wordpress.pastebin.ca/

    Thread Starter riasaurusrex

    (@riasaurusrex)

    Here’s the full header.php

    https://wordpress.pastebin.ca/1390624

    sure you can. first you have to create new page template. to do that copy everything inside your index.php then create a new php file and name it any name you prefer then paste every you just copied. insert this code above your new php file:

    <?php /* Template Name: ANY NAME YOU PREFER
    */ ?>

    save it.

    then go to your dashboard>>pages>>add new>>your page’s name in your case it’s about

    at the right side under the attribute there is a dropdown list label PARENT choose your template name then save it.

    going back to your new php file you can now edit your page!

    Thread Starter riasaurusrex

    (@riasaurusrex)

    Is this all I need at the top of the newly created page (aside from all the code from the index.php that i copied and pasted)?

    <?php about ?>

    It’s not showing up in the drop down menu under pages.
    All that is showing is ‘Main Page (no parent)’.

    Thanks for helping me out.

    <?php /* Template Name: ANY NAME YOU PREFER
    */ ?>

    just change ‘ANY NAME YOU PREFER’ so it will become

    <?php /* Template Name: about
    */ ?>

    Thread Starter riasaurusrex

    (@riasaurusrex)

    You’re a rockstar, thank you so much!

    you’re welcome

    Thread Starter riasaurusrex

    (@riasaurusrex)

    So, now it shows up under the templates drop down, but I get this message when I go to the page:
    Parse error: syntax error, unexpected T_STRING in /home/planpla9/public_html/blog/wp-content/themes/atahualpa/about.php on line 1

    i thought you’re good now hehe, anyway if you’re sure you pasted the code above, really above no other code before

    <?php /* Template Name: about
    */ ?>

    then there might be unnecessary characters there. check…
    paste the exactly the same as above same lines you have two lines there if you noticed.

    Thread Starter riasaurusrex

    (@riasaurusrex)

    got it.
    thank you.
    again.

    One more question, any idea why the styling in a sidebar text box widget would render fine on the index page and not the about page?

    that’s impossible since you just duplicated the index file right? try to repeat the process

    Thread Starter riasaurusrex

    (@riasaurusrex)

    hrumph…not sure what to do now to override the what’s set for the header on the main page

    hey don’t worry just delete your about php file and do it again maybe you just had a little error editing it.

    Thread Starter riasaurusrex

    (@riasaurusrex)

    Well, I have the new ‘about’ template working and what not. I’m just not sure how to go about changing the header image since it’s rendered through the theme options php. I’m pretty clueless with PHP, if you haven’t noticed…

    thanks.

    i understand here is what you should do, go to your about.php then find this code <?php bloginfo(template_directory);?>your image url(where your image is located). then upload your new header image(should be .png .jpg or .gif format) to the same directory.replace your old header image with your new one to you php file

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Different header image on About Page’ is closed to new replies.