Archived topic
Creating A Content Box Above Post
9 replies · Started by Joezer on March 7, 2020
Hello,
I am trying to center a box above the post like in this site. It works well if the site container width is wider than my box. But the URL I submitted only has 768px site container width and I am trying to make a box that has 1000px because I am going to put a 970px ad inside it. How do I center this box? It is using inside_site_container hook.
Thanks
Hi there,
What about the inside_container hook?
https://docs.generatepress.com/article/hooks-visual-guide/
Let me know :)
Yes, I tried that. I tried all the hooks between header and content title, but it still becomes like the URL that I've submitted privately.
Can you add it using the after_header hook and let me have a look?
Hello,
You can check it out here.
Can you try setting it to priority 15?
Let me know :)
That moved it :) Only problem now is how to center the box. Can you help me with this?
Add:
margin-left: auto;
margin-right: auto;
along with the CSS you are already using.
Worked. Thank you so much! :)
No problem :)