- This topic has 25 replies, 3 voices, and was last updated 3 years, 5 months ago by Leo.
-
AuthorPosts
-
November 9, 2020 at 4:22 am #1523627Mouse
Want the main heading of the post and image to come on top (Centered) and content and sidebar to come after, right now I can see the sidebar is coming alongside with the heading and the image.
November 9, 2020 at 5:28 am #1523698DavidStaffCustomer SupportHi there,
create a Header Element for your single posts:
https://docs.generatepress.com/article/header-element-overview/
Add this to the header element content:
<h1>{{post_title}}</h1> {{custom_field._thumbnail_id}}
Set the Display Rules to
Posts > All Posts
This will place the title and the post thumbnail above the content.
Then create a Layout Element with the same display rules to disable the Content Title and Featured Image:
https://docs.generatepress.com/article/layout-element-overview/
November 9, 2020 at 7:41 am #1524059MouseI did that one on of my post and now the image is small and not full sized. Link added below
November 9, 2020 at 8:28 am #1524125MousePlease help me out with this. I’d be very grateful <3
November 9, 2020 at 8:34 am #1524129MouseI want the image to be centered (full image) with title above centered. And want sidebar to start with the main content after that image. With a proper margin/padding so it looks good.
November 9, 2020 at 8:43 am #1524135DavidStaffCustomer SupportDo you have any custom functions added to your site?
Something similar to this one:
https://generatepress.com/forums/topic/featured-image-in-the-header-element/#post-1472919
November 9, 2020 at 8:49 am #1524145MouseNo other function is being added. Its all theme.
November 9, 2020 at 10:06 am #1524269LeoStaffCustomer SupportWhat’s the size of the image you are uploading?
It’s only 300 by 221 from what I can tell and that’s too small.
November 9, 2020 at 11:57 am #1524404MouseOkay then what should I do?
November 9, 2020 at 12:04 pm #1524414LeoStaffCustomer SupportIf you want a full-width image, then try uploading something with a width of at least 2000px.
November 9, 2020 at 12:07 pm #1524420MouseNo you are not getting the point. I want the same featured post image and the title above on posts to be centered and align the sidebar with the content that starts after the featured image.
November 9, 2020 at 12:14 pm #1524432MousePlease see the link in private info. as you can see the sidebar starts alongside the header h1. I want the featured image to be centered and want the sidebar to start aligned with the content after.
November 9, 2020 at 1:03 pm #1524464MouseHi still wating on the solution. Please help.
November 9, 2020 at 1:37 pm #1524498MouseI am attaching the image on what I want to do with the page. Please look at the image. Added in private info.
November 9, 2020 at 2:25 pm #1524546LeoStaffCustomer SupportHere is what you need to do to create that layout.
– Create a
[post_thumb]
shortcode using the following PHP snippet:add_shortcode( 'post_thumb', 'db_get_full_thumbnail' ); function db_get_full_thumbnail() { ob_start(); echo get_the_post_thumbnail( get_queried_object_id(), 'full' ); return ob_get_clean(); }
Adding PHP: https://docs.generatepress.com/article/adding-php/
– Create a header element with the following content:
<h1>{{post_title}}</h1> [post_thumb]
– Set the horizontal alignment to center:
https://docs.generatepress.com/article/header-element-overview/#horizontal-alignmentPlease note that we reply to every question within 12 hours – it’s usually much shorter.
Thanks for your patience.
-
AuthorPosts
- You must be logged in to reply to this topic.