• Resolved makmagnus

    (@makmagnus)


    Hi, I am pretty new to wordpress and I tried to create a website with a static front page and a “normal blog” page. (wwww.magnusmulyadi.com) I used the radclife theme (which I loved so much..) and had successfully created the static front page. However when I tried to access the blog page, it went blank. Any help? I figured I might write the wrong code for my index.php

    <?php
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define(‘WP_USE_THEMES’, true);

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );

    any help?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi Magnus,

    Welcome to WordPress.

    The code you referenced above is in the index.php file of the root directory of WordPress. You should never touch that file. It’s not what determines how your theme works. If you changed code in this file, please revert it back and see if that solves your issue. You can download a new install of WordPress and just copy/paste the index.php file.

    There is an index.php file inside the /wp-content/themes/radcliffe/ folder that has code in it that will tell your theme how it should display content. But you should also use caution updating this file. If the theme author releases a new version, your changes will be erased. WordPress uses child themes for those kind of customizations.

    Did you go to Appearance > Customize and choose to show a static page as your front page? Can you post a screenshot of what that looks like? I can try to help you further if I can see your setup.

    Thread Starter makmagnus

    (@makmagnus)

    Hi Dave,

    Thank you for the quick reply and thoughtful recommendations!

    I realized that I did not changed any part of the index.php, for when I checked with my other website’s index.php; it stated the same thing.

    Cool I will start by installing the child theme, after that, what kind of coding do I need to put in the theme’s index.php to make sure that the blog page will appear and its post will not redirect me to my static page (another problem in my blog)

    Yes I did this is what it looked like:

    This is the one in the reading page:

    OK, Magnus, you’re on the right track with that setup.

    If all you want is a simple page to be your homepage, and your blog to be a simple list of your posts, technically, you wouldn’t need a child theme. (but it’s always good to learn what they are and when they should be used)

    This WordPress codex page provides an example for the setup you’re trying to achieve. It sounds like you’re almost there.

    Add content to your “Home” page. This should appear on the homepage of your site.

    Make sure your “Blog” page is using the Default Template. Look in the right sidebar for Page Attributes, and if there is a dropdown box for Template, make sure it’s the default one.

    And of course, make sure you have at least one published Post on your site, otherwise nothing will show up.

    Thread Starter makmagnus

    (@makmagnus)

    Hi Dave, I’ve learned how to create a child theme and how it works. I have also followed the step by step guide provided in the WordPress codex page. I think I have done the right thing and you have provided the right advises.

    However, I think the problem is with the index.php; because every time I clicked to my post, it will link back to the static page. Any ideas what to do?

    Thanks

    I’m not sure I understand what your problem is. I just went to your site, and I see that there is no content on the homepage, and I couldn’t find any way to get to a blog page, or a single post, so it’s hard for me to understand what’s going on.

    • Have you created two static pages in WordPress? One for “Home”? One for “Blog”?
    • Have you assigned the “Home” page to be the static front page in your settings?
    • Can you confirm that you have added text in the content area to your “Home” page?
    • Have you assigned the “Blog” page to be your blog posts page in your settings?
    • Can you verify that you have an index.php file in the root of your theme folder, and that you have not edited it?

    If you have done all of these things, then you should see some static content on your homepage, https://www.magnusmulyadi.com/, and you should see all of your “Posts” appearing on your “Blog” page.

    Perhaps a screencast would help me understand what’s going on.

    Thread Starter makmagnus

    (@makmagnus)

    Hi dave,

    I am very sorry, I was trying to reboot my site and backing up all the themes, etc trying to see which causes the problem (hence the empty page). However I realized that the problem lies in the index.php. I am positive I have done the steps correctly (the way you recommended it on the codex. page).

    The problem is when I clicked the posts in my blog page, it will go back to my static home page. As of for the home page, I used site origin to create the landing page. Thus it may look empty but it really isn’t.

    Feel free to visit my website again. I am very sorry for the inconvinience

    I see what you’re saying. I’m experiencing the same problem.

    Try going to your Settings > Permalinks, and just click “Save Changes” again. This will flush your permalinks and re-create them. There might be something wrong with your permalink rules.

    Give that a shot and let me know.

    Thread Starter makmagnus

    (@makmagnus)

    WOW! That works!

    Can’t believe the solution was so simple. I realized now that the problem is in the permalinks structure.

    I used a custom permalinks in this fashion:
    %category%/%post%

    It works when I changed it to
    %postname%/

    Thanks Dave you are amazing!

    Thread Starter makmagnus

    (@makmagnus)

    Problem solved!

    My website j2stech.com has a blog post area in it called Exciting News. I published a post on sept 28 and saw it active on the website along with all the previous posts. Today I went to my website to look at my posts and saw they were not there although the Exciting News section was still in place. I went to the wordpress dashboard to try to figure out what was going on and created a new post and published it without public result. After reading some similar problems on the support page I decided to flush cache, update plugins, searched for and did not find and cache plugins that might be problematic and re-saved permalinks all to no avail. All my posts appear to be available and in published status in my wordpress dashboard but they simply do not appear on my website.

    Any suggestions?

    Glad it worked, Magnus. I wish I would have thought of that sooner ??

    @j2stechceo — Per the forum rules, please start a new topic. Each unique situation should have it’s own thread. I’d be happy to take a look once you do so. Thanks.

    wilco and done thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Static page & blank Blog page= wrong index.php code?’ is closed to new replies.