Solved

Customizing Static Home Page

Posted on 2011-02-21
9
491 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
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now