Site logo

Archived topic

Paragraph below the post title

21 replies · Started by Liran on September 17, 2020

Viewing posts 1–15 of 22

Hey,

Is there any way I can get this layout using GeneratePress?

Specifically, I'd like to have a paragraph below the post title (font should be a bit larger than a normal paragraph).

Any help would be appreciated!

Hey Leo,

If not we can probably make that work to show below the title.

Let me know how please!

Hmm on a second thought, using that method would mean that the blog/archives would also show the custom excerpt instead of the default excerpt word count.

Are you ok with that?

Sure, I don't see a problem.

Ok so just to make sure before we proceed.

You are ok with having the excerpt in the blog/archive page to be the same as the paragraph underneath the title on single posts?

We can make them different as well - just the methods are quite different so I want to make sure before we proceed.

Let me know :)

I guess that would be okay. What happens if I don't add a custom excerpt to some of the posts?

Then there won't be any paragraph shown underneath the post title.

Do you always want the paragraph underneath the title?

Then we will go with another solution :)

I think it would be best if the paragraph only appears when there's a custom excerpt (as some of my older posts don't have it).

Ok let's give the excerpt solution a shot first.

- Create the excerpt shortcode using the PHP snippet here:
https://docs.generatepress.com/article/page-hero-examples/#example-4

Adding PHP: https://docs.generatepress.com/article/adding-php/

- Create a hook element and add the shortcode as the content:
https://docs.generatepress.com/article/hooks-element-overview/

- Select generate_after_entry_title hook with priority 2.

- Check to execute shortcode.

- Select Posts > All Posts in display rules.

Let me know :)

That worked better than I expected. Thanks!

No problem :)

Hey,

Sorry to bring this thread up again, but is there a way I can show the custom excerpt only inside the post?

I know I said it's not a problem, but I want to use the excerpt option in WP Show Posts, and it looks a bit awkward.

This will also be displayed in the Archive post excerpt.

Is there a way around it?

This archived topic is closed to new replies.