WordPress.org

Ready to get started?Download WordPress

Forums

Custom PHP index page won't work as expected (5 posts)

  1. orgzchaos
    Member
    Posted 1 year ago #

    So I have copied the actual loop.php page and used it for one of my custom templates but for some reason a simple <?php while ( have_posts() ) : the_post(); ?> won't return any posts for the customized template even thou it works fine in the main one, if I put in certain conditions such as <?php query_posts( 'meta_key=price&orderby=meta_value&order=ASC' ); while ( have_posts() ) : the_post(); ?> then the posts start to appear, otherwise they won't. Also the CSS gets buggy for the customized version, even thou the codes are exactly the same. I am quiet lost as to what could be causing this.

  2. Steven Jones
    Member
    Posted 1 year ago #

    Can you copy the full code of your index.php page into a pastebin please?

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    if I put in certain conditions such as <?php query_posts( 'meta_key=price&orderby=meta_value&order=ASC' ); ?> then the posts start to appear

    that is right; this is how it works in page templates.

    the CSS gets buggy for the customized version

    the index page might be using some of the classes output by body_class() for the styling;

    please post a link to your site to illustrate the differences.

  4. orgzchaos
    Member
    Posted 1 year ago #

    @Steven Jones this is what index.php looks like and this is what loop.php looks like ( there is no loop-index.php ).

    @alchymyth Sorry but the site isn't URL ready but you can find the relevant codes above and I can define the difference. Whenever I hover over a content box ( single post, featured image + excerpt ) it slides down and comes back to its place when the cursor is off it. No such thing when the main index is viewed.

  5. orgzchaos
    Member
    Posted 1 year ago #

    Now I have the URL as well, you can see it at honeystolemymoney.com.

    Please notice how the post dividers shifts down and back up when hovered and removed in the lowest price page.

    I have tried multiple stuff to no avail, but then again I am not much of an expert.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags