Minimum Add Image to every page on top of Tagline widget?

Community Forums Forums Design Tips and Tricks Minimum Add Image to every page on top of Tagline widget?

This topic is: not resolved

Tagged: ,

This topic contains 13 replies, has 2 voices, and was last updated by  braddalton 1 year ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #63553

    moxiegirl
    Participant
    Post count: 73

    The slider image shows on top of the tagline widget on the home page, How could you add a different static image to the top of every other page that shows in the same spot?

    #63593

    braddalton
    Participant
    Post count: 10202

    Create a custom field.

    Change the hook position, conditional tag in the code and the field type in the plugin settings to image using this tutorial http://wpsites.net/web-design/add-custom-field-before-sidebar-on-any-post/


    #64083

    moxiegirl
    Participant
    Post count: 73

    So the code you put on your site shows:

    add_action('genesis_before_sidebar_widget_area', 'wpsites_sidebar_custom_field');
    function wpsites_sidebar_custom_field() {
    if ( is_single() && genesis_get_custom_field('sidebar_custom_field') )
    echo '<div class="widget">'. genesis_get_custom_field('sidebar_custom_field') .'</div>';
    } 

    I need it to go above the Site Tagline on each page, so I need to change it to:

    add_action('genesis_after_header', 'header_image_custom_field');
    function header_image_custom_field() {
    if ( is_single() && genesis_get_custom_field('header_image_custom_field') )
    echo '<div class="widget">'. genesis_get_custom_field('header_image_custom_field') .'</div>';
    } 

    Is that how I’d do it? I’m working on Minimum Pro.

    #64098

    braddalton
    Participant
    Post count: 10202

    Well done!

    All you need to do know is create a new custom field and meta box using the ACF plugin and make sure you use exactly the same field name in the plugin settings.
    [php]
    header_image_custom_field
    [/php]

    Should image upload in the settings as well.


    #64235

    moxiegirl
    Participant
    Post count: 73

    Really? I got it? :D

    So I paste that at the end of the functions.php or do I add it in somewhere else. I don’t touch PHP much (as we know it frightens me) and I can’t make heads nor tails of the php file rhythm.

    #64236

    braddalton
    Participant
    Post count: 10202

    Please copy the code and paste it at the end of your child themes functions.php file using a text editor like Notepad++


    #64298

    moxiegirl
    Participant
    Post count: 73

    I added the code and got the plugin installed, but I must have a setting wrong in the plugin as the image doesn’t show up. Could you see what I have wrong?

    ACF Settings

    #64314

    braddalton
    Participant
    Post count: 10202

    Under options > style you will need to enable standard meta box and then you can add your image from the meta box from your edit screens which display the box according to your settings for Rules.


    #64351

    moxiegirl
    Participant
    Post count: 73

    I have enabled the Standard Meta Box. As before, I have the option to upload an image for those pages where it’s enable, but nothing shows up? ::confused::

    #64362

    braddalton
    Participant
    Post count: 10202

    Maybe easier to select the editor as the field type rather than image.


    #64365

    moxiegirl
    Participant
    Post count: 73

    That didn’t work either. Seems weird.

    #64367

    braddalton
    Participant
    Post count: 10202

    Did as i tested it.

    Field Type* WYSISWG Editor and then add your image to the new editor.


    #64373

    moxiegirl
    Participant
    Post count: 73

    I did pick WYSISWG editor and inserted the image. I took screen shots of the back and front end.

    Front End

    Back End

    #64377

    braddalton
    Participant
    Post count: 10202

    Not sure what you’ve missed.


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

You must be logged in to reply to this topic.