Adding a full screen image banner above blog title

Hello,

I am trying to add a full screen image banner in to a post entry however what happens is that the image slider created with The Grid hides the right hand column of the blog entry.

Here is a screen shot:

If this was a page and not a post I could just edit this with Pro and it would be a breeze but I would really like this to work as a post as all the posts will have the same format.

  1. image banner below the header
  2. right hand column with extra info
  3. post title
  4. post content

Is there a way to customise the post in order to achieve this? Alternatively I will just have resort to pages instead of posts. Or could you at least point me in the right direction? I would be great if Xtheme could add extra post customisation in the future.

Many thanks!

1 Like

Hi There,

You can achieve that with a Global Block shortcode: https://theme.co/apex/forum/t/global-blocks/24723.

Please try adding this custom code under functions.php file locates in your child theme:

add_action( 'x_after_view_global__navbar', 'x_print_section' );
function x_print_section(){
	if(is_singular( 'post' )){
		echo do_shortcode( '[your-global-block]' );
	}
}

Let us know how it goes!

Hummm yes and no - I can see the logic of a global block but after having added the code to function.php, created the block with the slideshow then placed the code of the block at the beginning of the post entry the result is the same as before. Am I missing something? Should I place the block code somewhere else within the post? …

Hi,

You don’t need to add the shortcode at the beginning of your post entry. The code provided by my colleague will do it for you automatically.

add_action( 'x_after_view_global__navbar', 'x_print_section' );
function x_print_section(){
	if(is_singular( 'post' )){
		echo do_shortcode( '[your-global-block]' );
	}
}

You just need to change [your-global-block] in the code with the shortcode of the global block you created.

Thanks

I have done this but the images are not showing. Even if it did work the problem with that solution is that the same slideshow will appear on all the posts which is not what I wanted as each post has its own specific images - I guess I will have to resort to pages and not posts which is a shame.

Hi,

I have checked again and the slider is actually not visible because you are using pro.

You need to change the hook from x_after_view_global__navbar to x_after_view_global__slider-below

add_action( 'x_after_view_global__slider-below', 'x_print_section' );
function x_print_section(){
	if(is_singular( 'post' )){
		echo do_shortcode( '[your-global-block]' );
	}
}

but since you will need a different slider for each post, your best option is to use the gallery format for post.

Add your images through Add Media

Thanks

Thanks Paul, yes the php code worked but yes it will just show one gallery on all pages. I guess there is no way to create a block and show this block in the given position on an individual post page. Visually the gallery post option is not what I had in mind so I guess I will have to look for a script which forces the shortcode for THE GRID under the header or use pages.

It is a shame that WP does not have category and tags for pages the same way it has for posts as this would just solve my issue in one go.

It would be great if the roadmap of Xtheme Pro could include more customisation for post items as I am sure I am not the only one who would find this extremely useful.

Thank you for all you help anyway.

UPDATE: following the category for pages tangent I just found a work around the category for pages option found in the following link with the code I needed http://www.wpbeginner.com/plugins/how-to-add-categories-and-tags-for-wordpress-pages/

I this way I can just build my blog using the layout versatility pages and not be visually restricted by using posts.

Glad you’ve found a solution, @bebang.

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