Image after Nav/menu bar

hello,
is there anyway of inserting an image just below the nav bar for each page i mean every page with its own image after the nav bar.
Thanks

Hi Ole,

Thanks for reaching out.

It’s possible, but you have to manually add upload the image and assign it through code. Example, please add this code to your child theme’s functions.php

add_action('x_after_view_global__navbar', 'display_image_per_page');

function display_image_per_page () {

global $post; 

$id = $post->ID;

$images = array (
233 => 'http://example.com/image1.jpg',
209 => 'http://example.com/image2.jpg',
238 => 'http://example.com/image3.jpg',
383 => 'http://example.com/image4.jpg',
9221 => 'http://example.com/image5.jpg'
)

if ( isset($images[$id]) ) { ?>

<div class="x-image-navbar"><img src="<?php echo $images[$id]; ?>"></div>

<?php
}

The 233, 209, and so on are the page or post IDs that you wish to assign the image URL. You will have to upload your images to Wordpress media library and use its URL for this code. You can modify this, delete, add, or edit existing entries. Please check this https://theme.co/apex/forum/t/setup-how-to-locate-post-ids/59, this should help you locating your page and post IDs.

And since you don’t have a child theme, then please check this https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.