Jump to content
Sign in to follow this  
stipto

Custom page template

Recommended Posts

stipto

Hey there, I've read another post about this, but I'm not sure what to do. On my homepage I have some stuff I want to build around the loop, and also some modifications I want to do to the loop (putting things in divs etc). This only applies to the homepage and because non-techy people will be working on the text, I want to keep the rest in a custom template. How to do this?

Share this post


Link to post
Share on other sites
catrina
On my homepage I have some stuff I want to build around the loop, and also some modifications I want to do to the loop (putting things in divs etc).
Have you considered using hooks that you can add to the loop? If you're not familiar with them, this tutorial can help you get started: http://www.pagelines.com/docs/base-child-theme Let us know if you need help with implementing one. A DIV layer should be easy to set up.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
stipto

Hi Catrina, I have played with hooks a bit, but I'm not too sure they will meet my requirements. I'll probably have to use pagelines_before_maincontent and pagelines_after_maincontent but here's the tricky part: It should only be visible on the homepage (a static page). And I'll be using this same stuff on other sites, but with slight differences.

Share this post


Link to post
Share on other sites
stipto

Hi Adam, Thanks, I've read all the Conditional Tags, but couldn't find none that indicates what sub-site you're on (ID). Do you happen to know how to do this? Cheers.

Share this post


Link to post
Share on other sites
timlinson
It should only be visible on the homepage (a static page).
Isn't that what `is_home()` and `is_front_page()` do?
couldn't find none that indicates what sub-site you're on (ID).
I'm not sure I follow.. this sounds different than your earlier posts. What do you mean by sub-site? Are you talking about multisite?

Share this post


Link to post
Share on other sites
stipto

Hi Tim,

Isn't that what
is_home()
and
is_front_page(
) do?
Yes, and I'll be using
is_front_page()

because I have static pages.

What do you mean by sub-site? Are you talking about multisite?
Yes I am. I'm building a multisite with a lot of sub-sites (wich probably isn't the right term). These sub-sites all have a pretty similar layout, except for some differences on the homepage. Hence my question about conditional tags for multisite. Btw, I understand this all has nothing to do with Platform Pro, but more with WP in general, so I really appreciate the time all of you are taking to answer these questions!

Share this post


Link to post
Share on other sites
cmunns

Well there is this conditional `is_multisite()` but as far as getting the front page of each sub-site try asking in the multi-site forum on wordpress.org. Someone they may have a better answer for you and we can help you plugin that answer to PlatformPro

Share this post


Link to post
Share on other sites
stipto

Thanks, I will and get back to you.

Share this post


Link to post
Share on other sites
stipto

I cracked it, thanks to this post on the WordPress forums. If anyone's interested, here's the simplified version of what I put in functions.php:

	function HomepageBlog1(){
		?>
	<?php if( is_front_page()) { ?>
	</div><div class="custom-home">Homepage1</div>
	<?php } ?>
	<?php }
	
	function HomepageBlog2(){
		?>
	<?php if( is_front_page()) { ?>
	</div><div class="custom-home">Homepage2</div>
	<?php } ?>
	<?php }
	
	global $blog_id;
	if($blog_id == 1) {
	   add_action('pagelines_loop_after_post_content', 'HomepageBlog1');
	} elseif($blog_id == 2) {
	add_action('pagelines_loop_after_post_content', 'HomepageBlog2');
	}
	

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×