Solved

Customizing Static Home Page

Posted on 2011-02-21
9
501 Views
Last Modified: 2012-05-11
I have a wordpress web site that I have customized. I'm trying to set up the home page to be a static page, with the exception of that I want the slider that is on the home page.

I created my own page template, however, it's not displaying the proper content, it's displaying content from another page.

I know how to control the settings for a static page, but how do I customize that specific static page to incorporate a nivoslider?

Thanks in advance
<?php /* Template Name: Home Page */ ?> 

<?php

/**
 * @package WordPress
 * @subpackage Magzimus
 */
get_header(); ?>

<?php if(ts_getoption('ts_show_slider') == 1): ?>
    <div id="slider-container">
    	<div id="slider-window">
			<div id="slider">
	    		<?php get_slider_posts(5); ?>
    		</div>
    		<div class="clearer"></div>
    	</div>
    	<div class="nivo-controlNav">
    	<?php get_slider_thumbnails(5); ?>
    	</div>  		



    </div>



    <div class="clearer"></div>



	<div id="main" class="containerblock">



		<div id="content">



			<h2 class="post_title"><?php the_title(); ?></h2>



		    				<div class="clearer"></div>



			    			<div class="entry">



				    			<?php 



				    				the_content();



				    				wp_link_pages();



				    				edit_post_link();



				    			?>



			    			</div>



		    				<div class="clearer"></div>



		    			</div>



	         		



			<?php else : ?>



				<div class="post">    				



		    		<div class="entry">



						<h2 class="title"><?php echo ts_getoption('ts_not_found_title'); ?></h2>



						<p><?php echo ts_getoption('ts_not_found_text'); ?></p>

					</div>

				</div>

		        <?php endif; ?>

		</div>		

		<?php get_sidebar(); ?>

		<div class="clearer"></div>

	</div>



	<?php get_footer(); ?>

Open in new window

0
Comment
Question by:BluesMama
  • 5
  • 4
9 Comments
 
LVL 23

Expert Comment

by:jeremyjared74
ID: 34947868
So, you already went to Settings>Reading: and chose front page displays- static, and chose your page from the drop down list?
0
 

Author Comment

by:BluesMama
ID: 34951675
I created this page template you see above. Went in to pages, and created a page based off of this template and saved it. I went in to readings and selected that page, however, that page does not show up. It shows up for a 10 day camp when it should be some home text stating prices the same as last year. When I go in to administer my pages, the page that I created is there with the original content. So I'm not understanding what is going on.
0
 
LVL 23

Expert Comment

by:jeremyjared74
ID: 34951708
I believe you need to go back to settings and change it to Front Page Displays: Static Page, not Latest Posts. If that doesn't do it, you might want to replace your custom page.

Did you copy the single.php, page.php, or index.php for the custom page?
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:BluesMama
ID: 34951981
I have it set to the static page that I created off of the template I created.
I copied the index.php because I wanted the slider.
0
 
LVL 23

Accepted Solution

by:
jeremyjared74 earned 500 total points
ID: 34953369
The reason it is showing posts is because your index.php is for the posts page. If you will copy your page.php instead of the index.php then paste it inside the code shown here it may work. I am not sure how the slider is set up, but it should unless there is a specific tie to the posts through a hook.

Here is what needs replaced:
 
<div id="main" class="containerblock">



                <div id="content">



                        <h2 class="post_title"><?php the_title(); ?></h2>



                                                <div class="clearer"></div>



                                                <div class="entry">



                                                        <?php 



                                                                the_content();



                                                                wp_link_pages();



                                                                edit_post_link();



                                                        ?>



                                                </div>



                                                <div class="clearer"></div>



                                        </div>



                                



                        <?php else : ?>



                                <div class="post">                              



                                <div class="entry">



                                                <h2 class="title"><?php echo ts_getoption('ts_not_found_title'); ?></h2>



                                                <p><?php echo ts_getoption('ts_not_found_text'); ?></p>

                                        </div>

                                </div>

                        <?php endif; ?>

                </div>          

                <?php get_sidebar(); ?>

                <div class="clearer"></div>

        </div>



        <?php get_footer(); ?>

Open in new window


Replace that with the page.php content from the <div id="main" class="containerblock"> to the <?php get_footer(); ?> with the code from the single.php (no need to copy the <?php get_header since it is already at the top of the custom page.
0
 

Author Comment

by:BluesMama
ID: 34955524
I will try this. Thank you.
0
 

Author Comment

by:BluesMama
ID: 34966630
This worked along with completing my code with
<?php endif; ?> it works now.
Thanks!
0
 
LVL 23

Expert Comment

by:jeremyjared74
ID: 34966775
You're welcome, and good job catching the <?php endif; ?> .
0
 

Author Comment

by:BluesMama
ID: 34966786
I truly appreciate the help. Sometimes you can see forest the trees.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
Find out what you should include to make the best professional email signature for your organization.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question