Solved

Customizing Static Home Page

Posted on 2011-02-21
9
525 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

623 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