Solved

Customizing Static Home Page

Posted on 2011-02-21
9
516 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

734 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