• Im creating a primarily static site, however the programs page needs to be updated dynamically.

    What im looking to do is have a different header image on each page. How do i do this so that image 1 appears once about is clicked, then image 2 appears once programs is clicked and so forth

    my nav links are currnetly absolute links not using the wp_list_pages

    please see maclaarte.org/wordpress

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can do this by adding custom field.

    You will easily found help on WordPress Custom Fields.

    Some plugins also available for that, Custom Field Template one of these

    Thread Starter chuco61

    (@chuco61)

    there isnt a simple function to accomplish this? i cant seem to get any to work.

    my site is less than 10 pages.

    I think it is the best practice and simplest way of doing that.

    By using custom field you can easily manage images from admin panel of wordpress.

    Just use this Custom Field Template plugin, it make the task even more simple.

    Thread Starter chuco61

    (@chuco61)

    maybe im not understanding their documentation. once i add the plugin, do i create a div where i want the custom image header then place the image location into the custom filed?

    Yes your are right. Do the following steps:

    1. Create a custom field using plugin or manually (for exmaple: header_pic).
    2. Upload an image for header in media library.
    3. Copy the path of images and paste into the custom field.
    4. Retrieve the url in an variable from custom field in your template page by using <?php $image_url = get_post_meta($post->ID, ‘header_pic’, true); ?>
    5. Now you may use it as you want.

    Thread Starter chuco61

    (@chuco61)

    im still not able to get it to work. i beginning to understand a little.

    i added under my about PAGE custom filed name is header_pic then value is <img alt=”about us” src=”https://maclaarte.org/wordpress/wp-content/themes/NEWmacla/images/programs-bg.jpg”/&gt;

    then in my header.php where i want the image to appear i have <?php $image_url = get_post_meta($post->ID, ‘header_pic’, true); ?>

    im not sure if get_post_meta is an issue since im adding this to the pages not a post

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘A little confused’ is closed to new replies.