- This topic has 33 replies, 3 voices, and was last updated 6 years, 10 months ago by Leo.
-
AuthorPosts
-
May 26, 2017 at 12:53 pm #324601Terrell Jerry
Hello Thomas,
How do I get the banner to how up on the blog while using sections. I have the code to make the sidebar show up while using sections but I need a code for the 728×90 banner to show up in the inside content container and I don’t want it to show up on the home page.
I look forward to your response.
thanks,
Jerry
May 26, 2017 at 3:06 pm #324646LeoStaffCustomer SupportHi Jerry,
There are several GP hooks you might be able to use depending on where you want the banner:
http://demo.generatepress.com/hook-locations/
https://docs.generatepress.com/article/hooks-overview/Then use conditional tag to make it show up on that page only:
https://codex.wordpress.org/Conditional_Tags#The_Main_PageLet me know if you need more info ๐
May 26, 2017 at 3:23 pm #324663Terrell JerryHello Leo,
I would like the banner to show up on the blog while using sections. I already have the code for it not to show up on the homepage but I want it to show on the blog and single post inside content container.
thanks,
Jerry
May 26, 2017 at 3:25 pm #324664LeoStaffCustomer SupportHave you tried the inside content container hook shown above?
How are you displaying blog using section currently? Can you link me to the page?
May 26, 2017 at 3:52 pm #324673Terrell JerryEverything is in the draft and private mode the site isn’t live yet but will be real soon. Just trying to make sure my banners are in place to collect emails.
Yes, I’ll be using sections for the blog page to display all blog post.
I currently have this code in the inside content container hook.
thanks,
Jerry
May 26, 2017 at 3:52 pm #324674Terrell JerrySorry code :
<?php if ( ! is_front_page() ) : ?><script data-oio-zone=”type=banner&zone=2&align=center&refresh=0″>
(function(w,d,e,o,u,s,t){w[o]||(w[o]={},s=d.createElement(e),s.src=u,s.async=1,
t=d.getElementsByTagName(e)[0],t.parentNode.insertBefore(s,t))})(window,document,
“script”,”oiopub”,”http://zippsurge.com/wp-content/plugins/oiopub-direct/zones.js”);
</script><?php endif; ?>May 26, 2017 at 3:54 pm #324675LeoStaffCustomer SupportThe sections add-on actually won’t work for the blog page: https://generatepress.com/forums/topic/sections-in-posts-page/
May 26, 2017 at 5:06 pm #324689Terrell JerrySo are you saying that my blog post summary will not show with sections activated.
May 26, 2017 at 5:24 pm #324690LeoStaffCustomer SupportYou won’t be able to activate Sections the main blog page.
WordPress ignores all metaboxes on blog/archive and other index pages by default.
An alternative is to use Tom’s WP Show Posts: https://wpshowposts.com/
Then you can insert shortcode in Sections.
May 26, 2017 at 5:37 pm #324691Terrell JerryOkay, I understand that. What I’m trying to make my banner 728×90 show up on the blog and when you click the blog post. Will the banner show up while using sections on the blog tab.
I show you an example below.
See how John 728×90 banner shows up without the blog text image showing up. When you use sections on the blog page that blog text dosen’t show.
It looks like he created a blue banner with the white text Blog. But in wordpress that text shows up twice when I have a banner like John.
When I activate sections that secound blog text goes away.
thanks,
Jerry
May 26, 2017 at 5:46 pm #324692LeoStaffCustomer SupportSounds like you need two conditionals – one for the main blog page and one for single posts:
https://codex.wordpress.org/Conditional_Tags#The_Main_Page
https://codex.wordpress.org/Conditional_Tags#A_Single_Post_PageWhen Sections is activated, the layout of the page is wiped clean as it acts like a page builder.
If you can put your site up on a temporary server it would be much easier for me to see whats’ going on ๐
May 26, 2017 at 6:04 pm #324695Terrell JerryI can add you as a user if that would work Leo.
May 26, 2017 at 6:11 pm #324701TomLead DeveloperLead DeveloperHave you tried this?:
add_action( 'generate_before_main_content','tu_blog_banner' ); function tu_blog_banner() { if ( is_home() || is_single() ) { ?> Your banner in here <?php } }
May 26, 2017 at 7:10 pm #324722Terrell JerryDo I put this as snippet then activate it or where do it go.
May 26, 2017 at 7:15 pm #324723LeoStaffCustomer SupportYup Code Snippets: https://docs.generatepress.com/article/adding-php/#code-snippets
-
AuthorPosts
- You must be logged in to reply to this topic.