WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cant view my site's homepage without logging in (7 posts)

  1. anant.nigam
    Member
    Posted 1 year ago #

    I have created a WordPress site. When I log-in into WordPress dashboard then only I can view my site's homepage else it gives 404- not found error. But, my other pages are working fine. If I type in url for any other page in this site, then its opening without requiring to log in. What did i do wrong?

  2. Code Metic
    Member
    Posted 1 year ago #

    What is your theme name?

  3. anant.nigam
    Member
    Posted 1 year ago #

    Theme name is 'SimplePv'. I made this theme.

  4. Code Metic
    Member
    Posted 1 year ago #

    Can i post your index.php file script?

  5. anant.nigam
    Member
    Posted 1 year ago #

    index.php file content:

    <?php get_header(); ?>
    	<section>
    	    	<?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post() ; ?>
        		<h1><?php the_title() ?></h1>
    				<?php the_content('') ?>
                    <?php endwhile; ?>
                    <?php endif; ?>
    	</section>
    </div>
    <?php get_footer(); ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  6. anant.nigam
    Member
    Posted 1 year ago #

    index.php file content:

    <?php get_header(); ?>
    	<section>
    
    		    	<?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post() ; ?>
        		<h1><?php the_title() ?></h1>
    				<?php the_content('') ?>
                    <?php endwhile; ?>
                    <?php endif; ?>
    	</section>
    
    </div>
    <?php get_footer(); ?>
  7. anant.nigam
    Member
    Posted 1 year ago #

    ok, got the problem. i had my home set to a static page and that page was marked as a draft, so it was not fetching it directly.

Topic Closed

This topic has been closed to new replies.

About this Topic