WordPress.org

Forums

[resolved] Upload form in place of latest posts on home page??? (6 posts)

  1. Tijar
    Member
    Posted 11 months ago #

    I have a strange problem. On my home page, there are 5 lines for upload, however, it should be 5 latest post. Can anyone help me please!

    http://vanglaplaneet.ee is aadress.

    Thanks a lot!

  2. Kidcompassion
    Member
    Posted 11 months ago #

    The good news is, the mobile view of your site works! Can you do two things for me?

    1) can you go into your dashboard, and in the left nav, go to Settings>reading

    In there, you'll find a control to choose what the from page of your site shows; either recent posts or a static page. Tell me, Is it set to recent posts?

    2)if it is set to have recent posts on the front page, can you look in your theme and copy the contents if the index.php file and paste them here?

  3. Tijar
    Member
    Posted 11 months ago #

    Thank you very much!

    Yes, it's set to "recent posts" and when i set it to "static page" it work nicely.

    I use Twenty Eleven Theme with my own Twenty Eleven Child Theme.

    This is original Twenty Eleven Theme:

    <?php
    /**
    * The main template file.
    *
    * This is the most generic template file in a WordPress theme
    * and one of the two required files for a theme (the other being style.css).
    * It is used to display a page when nothing more specific matches a query.
    * E.g., it puts together the home page when no home.php file exists.
    * Learn more: http://codex.wordpress.org/Template_Hierarchy
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    */

    get_header(); ?>

    <div id="primary">
    <div id="content" role="main">

    <?php if ( have_posts() ) : ?>

    <?php twentyeleven_content_nav( 'nav-above' ); ?>

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( 'content', get_post_format() ); ?>

    <?php endwhile; ?>

    <?php twentyeleven_content_nav( 'nav-below' ); ?>

    <?php else : ?>

    <article id="post-0" class="post no-results not-found">
    <header class="entry-header">
    <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    </header><!-- .entry-header -->

    <div class="entry-content">
    <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    <?php get_search_form(); ?>
    </div><!-- .entry-content -->
    </article><!-- #post-0 -->

    <?php endif; ?>

    </div><!-- #content -->
    </div><!-- #primary -->

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    And this is my Twenty Eleven Child Theme:

    <?php
    /**
    * The main template file.
    *
    * This is the most generic template file in a WordPress theme
    * and one of the two required files for a theme (the other being style.css).
    * It is used to display a page when nothing more specific matches a query.
    * E.g., it puts together the home page when no home.php file exists.
    * Learn more: http://codex.wordpress.org/Template_Hierarchy
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    */

    get_header(); ?>

    <?php if ( function_exists( 'get_roster_slider' ) ) { get_roster_slider(); } ?>

    <div id="roster_slider_margin"></div>

    <div id="primary">
    <div id="content" role="main">

    <?php if ( have_posts() ) : ?>

    <?php twentyeleven_content_nav( 'nav-above' ); ?>

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( 'content', get_post_format() ); ?>

    <?php endwhile; ?>

    <?php twentyeleven_content_nav( 'nav-below' ); ?>

    <?php else : ?>

    <article id="post-0" class="post no-results not-found">
    <header class="entry-header">
    <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    </header><!-- .entry-header -->

    <div class="entry-content">
    <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    <?php get_search_form(); ?>
    </div><!-- .entry-content -->
    </article><!-- #post-0 -->

    <?php endif; ?>

    </div><!-- #content -->
    </div><!-- #primary -->

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thank you again for your time!

  4. Kidcompassion
    Member
    Posted 11 months ago #

    Oh! This might not be it, but I just talked to someone with a similar issue, so let's check!

    The core wordpress themes use template parts to handle large volumes of code (here's another thread where I explain that in more detail).

    So first, try commenting out this line in your child theme:
    <?php get_template_part( 'content', get_post_format() ); ?>

    and see what happens to your front page.

    If the forms disappear, and the page still works (it just won't have any posts),then that means the problem is inside your content template, which is called content.php. So then, I would suggest looking inside your child theme to see if you have a file called content.php? If you do, look inside of it and see if it contains an upload form, or any code that might be calling another template with an upload form.

    The loop on your index page is working, because it's showing multiple things - it's just not showing the multiple things that we want. :) So I bet you have a conflict somewhere with your template file.

  5. Tijar
    Member
    Posted 11 months ago #

    I don't have words to thank you!!! In content.php, there was really weird stuff! :) But I replace it wiht original code and now everything is working again. Thank you again for everything you’ve done! Lifesaver! :)

  6. Kidcompassion
    Member
    Posted 11 months ago #

    Yay! Very glad to have helped!

Reply

You must log in to post.

About this Topic

Tags

No tags yet.