WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Page Help (20 posts)

  1. RChiiton
    Member
    Posted 2 years ago #

    I have created a custom theme and used it multiple times as a single landing page using home.php as the landing page. Works fine no issues.

    Now I'm trying to add a second page with it's own page template and something is not working correctly. I've created another page template and called it sedation.php. I've edited the template name in the sedation.php file. The page shows up in my templates in the dropdown list of the dashboard - all good.

    If the page is still in the "draft" mode and you view it and you can see it perfectly but once I "publish" the page then I get a page error.

    I'm guessing I am missing some code relevant to pages somewhere in my theme but I've researched a looked a can not figure out what it is. Trying to make this site live and can not do it until I get these pages viewable.

    Thanks for the help.

  2. gerald@WPcustoms
    Member
    Posted 2 years ago #

    can you please post the page error you get?

  3. RChiiton
    Member
    Posted 2 years ago #

    Sorry, it's not really a page error - it's a "page not found".

    Thanks

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    What are you actually linking to? Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance other than semi-wild guesses.

  5. RChiiton
    Member
    Posted 2 years ago #

    Here is a link to the homepage.

    http://whistlerworks.com/clients/winterssmilemakeover/site/

    Any of the page links at the top are pages that have different page templates. When you preview the pages in draft mode they appear as they should when you publish the pages - they then say page not found.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    I think this is an issue with your root site's .htaccess rewrites - not your templates. Looks like all calls to any page other than the sub-folder root are being directed to your main site.

  7. RChiiton
    Member
    Posted 2 years ago #

    there is no .htaccess file.

    solution?

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    Yes there is. Your main site uses custom permalinks.

  9. RChiiton
    Member
    Posted 2 years ago #

    Well I didn't make one. If there is one I'm not sure where it is, and I'm not clear on how that is affecting my pages not being visible and I'm not sure what the solution to the problem is.

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    WordPress creates it automatically when you set up custom permalinks. Try looking in your root domain folder using FTP - but do ensure that your ftp client is configured to show all files. Many clients hide .htaccess files by default.

  11. RChiiton
    Member
    Posted 2 years ago #

    I use cyberduck. I've looked through the root folder and can not find an .htaccess file, which is why I did not think there was one. If cyberduck is hiding the file how do I make it visible and what do I need to change or add within the file.

  12. RChiiton
    Member
    Posted 2 years ago #

    The show hidden files is checkmarked in cyberduck and I don't see a .htacces file.

  13. esmi
    Forum Moderator
    Posted 2 years ago #

    What sort of server are you using - Windows or Linux?

  14. RChiiton
    Member
    Posted 2 years ago #

    It is setup to use Linux. I found the .htaccess files in some of my other sites in cyberduck.... even though show hidden files is checked I still had to do a search. When I did that on the site I'm working on no .htaccess file came up so I made one put all the same text in it as my other sites. Refreshed my files and the pages still do not work. I've tried switching themes and still the same problem. In preview the page shows up. When published the page is not found. Extremely frustrating.

  15. esmi
    Forum Moderator
    Posted 2 years ago #

    It's the .htaccess file in your root domain that it probably causing the problem.

  16. RChiiton
    Member
    Posted 2 years ago #

    yes, it is in exactly the same place as my other websites.

    winterssmilemakeover/site

    Then you have all the files...

    .htaccess
    index.php
    wp-admin
    wp-content

    etc.. etc.

    btw....I really appreciate your help because I am stumped and trying to make this site live.

  17. RChiiton
    Member
    Posted 2 years ago #

    This is what I put in the .htaccess file, copied it from a site that is functioning properly

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  18. RChiiton
    Member
    Posted 2 years ago #

    I've used this custom theme before I don't usually have additional pages. But I just tested another site using it and I can see the page.

    I've tried switching themes and I still do not see the pages.

    The only code that I think I changed other than some css is I added

    this to the function.php file

    add_action('init', 'register_custom_menu');

    function register_custom_menu() {
    register_nav_menu('custom_menu', __('Custom Menu'));
    }

    and this to the header.php file

    <?php wp_nav_menu(array('menu' => 'custom_menu')); ?>

    But it seems like it is outside the themes otherwise I would think the page would work if i changed themes.

  19. esmi
    Forum Moderator
    Posted 2 years ago #

    Is that now the .htaccess file for http://whistlerworks.com - your root domain?

  20. RChiiton
    Member
    Posted 2 years ago #

    Got it.... had to change the file path in the .htaccess file.

    Appreciate all your help. My brain was about to explode.

Topic Closed

This topic has been closed to new replies.

About this Topic