Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to make a very simple landing page? (Newbie help)
Tagged: landing page hooks newbie
- This topic has 15 replies, 3 voices, and was last updated 9 years, 2 months ago by Yossif.
-
AuthorPosts
-
January 8, 2015 at 8:35 pm #136437YossifMember
Hi everyone. I need help, I'm still very new to this and I barely know any coding whatsoever. I'm using the generate theme.
I'm trying to make a very simple landing page. I'd like to make with no menu, no sidebar, nothing. Just a simple white page.
When I try to use the "Landing" template on the page editor, it removes most of it, but I still get the generate box, the comment sections, my hook-based ads, etc.
How do I make all the landing pages not load that extra stuff?I found this bit of code:
if ( !is_page_template('page_landing.php') )
But how do I use it?
Thanks!
-YossifJanuary 8, 2015 at 8:36 pm #136438YossifMemberI also found this page:
http://sridharkatakam.com/sales-page-template-genesis/
I think it would be great if it looked like that but I have no idea how to make a .php file or how to apply it to my blog. Can anyone help me with making this?
January 9, 2015 at 6:27 am #136464CleanPageDomParticipantHi there
To make a .php file, open up notepad or your favourite text editor, copy and paste the code from Sridhar's site into the blank doc, then save it as the name he suggests.
Then you'll need to upload it to your theme file over FTP. It should sit under WP-Content/Themes/YOUR THEME NAME - you'll see functions.php in there as well.
Then copy and paste the new CSS into the style.css file.
When you go to create a new page now, you should have the option in the dropdown to the right to choose "Sales" as a template.
Hope that makes sense. Let me know if not.
Thanks
Dom
January 13, 2015 at 10:39 am #137322YossifMemberThanks Dom, that seemed to do it...
However, I'm still having issues with my various genesis hooks displaying ads as well as my generate box showing up. Is there a way to disable all of that within only this page?
Maybe something with
if ( !is_page_template('page_landing.php') )
or replace it withif ( !is_page_template('page_sales.php') )
??Thanks!
-YossifJanuary 13, 2015 at 1:48 pm #137352CleanPageDomParticipantIt's not a perfect fix, but can you do something like this in your CSS (please check all of the elements with inspect element or similar first):
.page-id-X .generate-box { display: none; }
January 14, 2015 at 12:15 am #137385YossifMemberThanks, but I'm still really confused where to use this. I'm very very basic with coding, hell I don't know the difference between PHP and CSS yet... So please bear with me....
Here's the contents of my generate box plugin, hopefully this has something I can change to use this command?
http://pastebin.com/QPsDWyWqI tried to inspect the element, but wasn't sure what I was looking at once I was looking at the guts of the website. If you'd like to look at it yourself, the website is http://angrynutrition.com/
I'm guessing something needs to be changed to
if ( !is_page_template('page_sales.php') .generate-box { display: none; } )
(I think? Sorry, still very new to all of this!)
Thank you for your help so far!
-YossifJanuary 14, 2015 at 3:31 am #137398CleanPageDomParticipantOh, OK. So what I suggested would need to go in your style.css file. It can go anywhere, but I would suggest putting it somewhere logical (ie below the Nav rules so it sits neatly with the flow of the web pages) and comment it up inside
/* */
tags for reference.For example, looking at your home page:
body.home #generate_box { display: none; }
would remove the Generate box from the home page. So if you fire up your landing page and view page source, then do a find for "page-id-" then you'll see the page id. Then go:
body.page-id-X #generate_box { disply: none; }
That should remove the Generate box from the landing page.
Good work on the fitness, by the way. I'm becoming something of a fitness geek myself.
Dom
January 14, 2015 at 5:55 am #137418CarloMemberHi Yossif. You don't want to add any CSS code (i.e.
display: none;
) to do this. What you actually want to do is edit the templatepage_landing.php
. It should have a series of lines starting withremove_action
and you'll want to add more of these to remove each element of the page that you don't want. Can you share the link to the page you're talking about?
January 14, 2015 at 5:57 am #137419CleanPageDomParticipantThanks Carlo. Yes, I thought
display: none;
would be a quick, rather than an ideal, fix.
January 14, 2015 at 10:45 am #137451YossifMemberOK, I managed to get rid of the generate box like Dom suggested. Thank you for that Dom!
OK so now I'd like to remove the ghook-based ad's and the primary menu bar.
I used the simple hooks plugin to add the ad's code, so do I need to go through and remove all the stuff like
genesis_before_post_content Hook
with thisdisplay: none;
code? Or maybe there's something I can use to just disable all the hooks on this given page?Regarding the menu, based on the inspect code, would I alter something like
id="subnav
orid="menu-secondary
??Regarding what Carlo said, can stick that same bit of code into the page_sale.php and get the same thing as the style.css edit?
Thanks for all the help again!
-YossifPS: Thanks for kind words, Dom. What's your favorite type of exercise?
January 14, 2015 at 11:46 am #137457YossifMemberJanuary 14, 2015 at 2:14 pm #137469CleanPageDomParticipantHi Yossif
I think what Carlo is suggesting (and please correct me if I'm wrong, Carlo) is to add some more rules to the page template that you uploaded via ftp. Where Sridhar has, for example:
remove_action( 'genesis_after', 'genesis_footer_widget_areas' );
which will remove the footer widgets areas, there will be equivalent
remove_action
commands to get rid of the generate box etc. The benefit of this method is that a) it's actually the correct way to do things, and b) if you end up with multiple landing pages, you won't need to add additional CSS rules for each page - the CSS i gave you is page-specific.Now, unfortunately, I'm not overly familiar with these hooks and actions etc. Carlo sounds much more knowledgable than me on this. So, if you want my quick, hack(y) fix for one page only, then go:
body.page-id-2035 #generate_box, body.page-id-2035 #subnav, body.page-id-2035 #respond, body.page-id-2035 #footer-widgets { display: none; }
You might struggle to get rid of those iframe ad boxes though.
Hopefully Carlo can suggest the php way to do things with the page template.
As for fitness, I was huge as a teenager/early-20s, lost about 40lbs just through giving up a lot of alcohol and walking more, then started doing endurance and multi-sport about five years ago. Currently training for four triathlons and a duathlon this year. Trying out the Stronglifts 5x5 programme at the minute, along with sport-specific training and HIIT.
January 14, 2015 at 6:36 pm #137498YossifMemberYep, your code seems to have worked.
It may not be ideal, but hey, if it works, it works.
Let's see what Carlo might suggest for the rest of it, but at least we're a little closer now. I'm also getting more experienced as I mess around with this stuff... I'm not scared that a tiny little change will crash the site! (as it was doing earlier haha)
Those are some impressive activities you got going, Dom! It's pretty similar to what I've done in the past, but I don't think I could do a Triathalon/duathlon... that's some hardcore stuff! Good for you man.
-Yossif
January 15, 2015 at 9:29 am #137540CarloMemberHi Yossif. Dom is correct about what I was talking about.
To remove the comments from the page, you actually just turn them off in the page editing screen. The option is located in the Discussion section, which you may need to show by clicking on Screen Options if it's not already showing.
This is the code you want to add to the template
page_sales.php
, anywhere between the line<?php
and the linegenesis();
:remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' ); remove_action( 'genesis_after_header', 'genesis_do_subnav' ); remove_action( 'genesis_after_header', 'display_generate_box', 15 );
That will remove the generate box, subnav and the footer widgets.
The ads are going to be more difficult to remove because you used the Simple Hooks plugin, which is called Simple for a reason. It's really designed for if you want to add content to every page, not some pages. This is where it becomes difficult to help you out without access to your code.
January 15, 2015 at 1:22 pm #137589YossifMemberYes that worked, Carlo. Thanks to you both for the help so far.
However, I'm still unable to get rid of the secondary menu and the ghook-based ads. Is there something I can use to remove those or disable them within that same php?
looks like the menu is something with "subnav" or "menu-secondary"?
The ad that is in the way is on the "genesis_before_content_sidebar_wrap" Hook. Can I disable it somehow for this page?
Here's the page in question again: http://angrynutrition.com/10-diet-myths-ebook/
Thanks for the help!!
-YossifJanuary 16, 2015 at 9:24 am #137667YossifMemberOK I feel dumb. There already was a pre-made landing page template with everything already programmed in!
As for removing the ads, I found another thread with the similar issue, and this bit of code in the ghooks took care of it:
<?php if( is_page_template( ‘landing.php’ ) ) return; // add your adsense code for display ?>
So there you have it, all is good to go. Thanks for help guys!
-Yossif -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.