• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Creating a Page Template with top image

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Creating a Page Template with top image

This topic is: not resolved

Tagged: custom page template, page template

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 7 months ago by sandvall.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 8, 2016 at 4:43 am #189085
    sandvall
    Member

    Hi,

    I would like to create page template with a random top-image just below the black header with logo.
    Here is the link to the page so far: http://www.sandvall-demo.dk/page-3/
    Right now the random image are showing under the footer i would like to have it under the header.

    My code for the page template look like this:

    <?php
    /**
    * Template Name: TOPIMAGE
    * Description: Template used for the about page
    */
    
    genesis(); ?>
    
    <img src="http://www.sandvall-demo.dk/wp-content/uploads/headerimage_<?php echo(rand(1,3)); ?>.jpg"
    width="image_width" height="image_height" alt="image_alt_text" /> 

    Please advise.
    ATB
    Morten

    http://www.sandvall-demo.dk/page-3/
    July 8, 2016 at 7:59 am #189103
    Victor Font
    Moderator

    You need to hook the image into the genesis_after_header hook. https://my.studiopress.com/docs/hook-reference/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    August 10, 2016 at 5:36 am #191025
    sandvall
    Member

    Hi Victor,

    Thanks for the reply but how should the code look like then?

    Atb
    Morten

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble