WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help! Changing homepage to homepage.php (19 posts)

  1. michaelborger
    Member
    Posted 3 years ago #

    Hello everyone. Somehow my welcome screen totally changed.

    BigRockInvestments.com

    I used to have a welcome video with two columns underneath it in the central body. Now I get a generic welcome page. I have no idea how this happened - it was working fine yesterday.

    It appears to me that somehow the custom-created "homepage.php" is no longer the page loaded as the actual homepage. Where can I change this back? I'm assuming this is my problem, but I don't know how to make homepage.php the true home page again.

    Thanks in advance for your assistance.

  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    From your wp-admin dashboard, go to Settings->Reading

    Ensure that you have selected the option to display a static page on your homepage.

    Then, ensure that the correct page is selected to display.

  3. michaelborger
    Member
    Posted 3 years ago #

    That's what it is set to now. It's set to an individual page. What I'm looking for is the original layout which -- it appears to me -- is coded in homepage.php.

    So before today, the homepage had a welcome YouTube video (where the fake video splash graphic is now). There were also two columns of text below the video. In the left column was the content of the welcome page ("Welcome to Big Rock Investments"); in the second column was other text content.

    Now that's all been wiped out and replaced by a plain vanilla layout that calls the Welcome page.

    So that setting is somewhere else. Somewhere it should be calling homepage.php for the homepage layout. If I look inside homepage.php, I see coding for the specific YouTube video among all the other code.

  4. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Okay, so the next thing to check:

    Whichever page is set as the static Page to display on the front page: Edit this Page, and ensure that it is using the correct Page template ("frontpage" or "homepage", probably).

  5. michaelborger
    Member
    Posted 3 years ago #

    Thanks, but unfortunately that didn't work. I have only two options in the Template field: Default Template and Blog. It is now Default Template; blog converts it all to just plain text. Neither has the original layout of YouTube video and two columns.

    Is it not in a CSS or PHP somewhere to use homepage.php as the layout for the homepage?

  6. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    What Theme are you using?

    Unfortunately, your problem is one that is impossible to assess generically, as the problems you are having are entirely Theme-dependent.

  7. michaelborger
    Member
    Posted 3 years ago #

    This is a custom theme developed for me by some VAs. I wish it was a cookie-cutter theme - I agree that would make it easier to debug. But what gets me is that it was fine last night and the only thing I've since changed is some page titles in the All-In-One plugin for SEO purposes. That's it. Now I'm left wondering how in the world another setting somewhere or a PHP/CSS file got changed. I've no clue.

  8. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Without being able to see the Theme template files, the best I can say is probably to see if the folks that developed the site for you can figure out the problem?

  9. michaelborger
    Member
    Posted 3 years ago #

    Not likely since I burned that bridge after their refusal to complete the job.

    I found the following code for my page.php. It looks like the top has a condition to see if the page is the homepage... is this the key?

    <div id="bg2">
    <div id="wraper2">
      <div id="leftside">
    <?php get_header(); ?>
    
    <div id="Content">
    <div class="padright2">
    <?php if(the_home_page()){?>
    	<div class="video"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/video.jpg" alt="Vidoe" /></div>
    <?php } ?>
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
  10. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    That the_home_page() conditional is a custom function. Can you find where it is defined in your Theme's functions.php file?

  11. michaelborger
    Member
    Posted 3 years ago #

    The word 'home' is mentioned ten times, but here's the only section that contains the full string "_the_home_page"

    if(!function_exists('the_home_page')){
    	function the_home_page(){
    		if(the_slug() == 'home'){
    			return true;
    		}else{
    			return false;
    		}
    
    	}
  12. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Okay, you need to be using a page with a page slug of "home". You can leave the Page Title whatever you want, but the slug needs to be "home".

    Then that function will return true.

    That would also explain why changing your Page Titles caused the problem.

    (P.S. there are MUCH better ways to do this. I can try to help you make this a bit more flexible. But let's try to get it working as it was again, first.)

  13. michaelborger
    Member
    Posted 3 years ago #

    Ok, I'm starting to follow you now. So one of my pages should already have a slug of 'home'? I just looked at them all and none of them do. The only potential page that would serve as this is the aptly titled "Welcome to Big Rock Investments" page. However, this page has no slug and does not have the Edit button for me to enter one. It's as if it's "non-sluggable". The only button next to the permalink of http://BigRockInvestments.com/ is "View Page".

    And so I'm saying the right things, I did not change the actual WordPress page title field, I changed the page title in the All-In-One plugin section below the text body of the page which serves to overwrite the default WordPress page title. Hope this makes sense.

    Btw, thanks so much for helping me through this.

  14. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    You might try disabling the SEO plugin, just for troubleshooting purposes. (My own preference is not to use such plugins, anyway - but to each, his own).

    Are you saying that, on the Pages screen, you cannot see the field to edit the Page slug? And likewise from the Edit Page screen?

    My guess is, the correct page previously had a slug of "home", but that either you or the SEO Plugin changed it recently. Since the custom function is looking specifically for this Page slug, it's no longer returning "true", and you're not seeing your expected content.

    (And no worries; I'm happy to help!)

  15. michaelborger
    Member
    Posted 3 years ago #

    Ok I tried disabling the plugin, but no changes.

    It turns that I can view the slug on the Pages screen if I hit 'Quick Edit' and the current slug is indeed 'home' (no quotes). But if I go to the individual page itself, there's no option for me to input a slug. It's as if it's hardcoded to root domain "http://bigrockinvestments.com" .

    So if there current slug is really 'home', then I wonder why the function is not being invoked...

  16. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Can you do a screenshot of the Page Edit screen, showing what you see where the Page Title/Page Slug fields (normally) are?

  17. michaelborger
    Member
    Posted 3 years ago #

  18. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Yeah, that's really strange. Has it always been like that, or just recently?

  19. michaelborger
    Member
    Posted 3 years ago #

    I've never looked at it before like this, so I'm not sure. But it's working now. I had a contractor from Fiverr working on some layout prior to this snafu and he was able to fix it. I'm waiting to hear back from him what it was that did the trick, because I sure couldn't figure it out. If I find out, I'll be sure to post here.

    Thanks again for your assistance.

Topic Closed

This topic has been closed to new replies.

About this Topic