logo

$6
"More Tag" not working

Hi Experts,

I am having trouble with my "More Tag" working correctly.

I have a page template that pulls in posts from a specific category. I also have a custom 'single.php' file that loads a slightly different template for posts in this category.

I am having trouble with the more tag. The "read more" link will show up, but when you click it you get a Page not Found error.

Any insight you can provide is greatly appreciated.

Here are some code samples:


Code from page template that pulls in posts:

<ul class="news_list">


<li><?php
query_posts('cat=12');

global $more;
// set $more to 0 in order to only get the first part of the post
$more = 0;

// the Loop
while (have_posts()) : the_post();
// the content of the post
the_content('Read More &rarr;');
endwhile;
?></li>

</ul>







Code from single.php file that loads posts from the category above into a particular template:

<?php
if(in_category(12)) {
include 'single-12.php';
} else {
?>

...code for standards single template here ...

<?php } ?>

WP Answers | 07/07/10 at 12:09pm | Edit


(3) Possible Answers Submitted...

  • avatar
    Last edited:
    07/07/10
    2:07pm
    Oleg Butuzov says:

    remove more please....

    • 07/07/10 12:12pm

      Oleg Butuzov says:

      global $more;

      // set $more to 0 in order to only get the first part of the post

      $more = 0;

    • 07/07/10 12:14pm

      Oleg Butuzov says:

      sorry me wrong. we need at least a url to see the posts.

      can you also provide a structure that you are using for the permanent links?

    • 07/07/10 12:16pm

      WP Answers says:

      http://www.airclic.com/news-resources/airclic-in-the-news-new

      permalink structure is: /%postname%

    • 07/07/10 12:22pm

      Oleg Butuzov says:

      hm. it woks with the http://www.airclic.com/order%E2%80%99s-up

      so its good. somehow it lost somewhere... i am getting such erros whan i am working with parse_query filter... can you add to your header.php next code to debug

      <?php
      var_dump($wp_query);
      exit;
      ?>

      to the top please.

    • 07/07/10 12:26pm

      Oleg Butuzov says:

      check is this artcile published not schelduled

    • 07/07/10 12:35pm

      WP Answers says:

      Hi,

      If I edit the header.php file will the site still function?

      The site is live and needs to stay functioning.

      I have the new page I created hidden from the menu, so that is fine for now.

      When I try to access the post directly, I get the 404 page not found error.

      Maybe the error is not with "read more", but with the post itself?

      http://www.airclic.com/temporary-media-coverage-post

    • 07/07/10 12:40pm

      Oleg Butuzov says:

      <?php
      if (isset($_COOKE['BUTUZOV'])){
      var_dump($wp_query);
      exit;
      }
      ?>

      with this code site still will be aviable for a public and debug for me. also can i request admin login credentials to see post inside edition page?

    • 07/07/10 12:44pm

      WP Answers says:

      Hi,

      I added the code to the top of header.php:

      <?php

      if (isset($_COOKE['BUTUZOV'])){

      var_dump($wp_query);

      exit;

      }

      ?>



      Which login credentials do you need? wp-admin?

    • 07/07/10 12:47pm

      Oleg Butuzov says:

      2Five Squared
      yeah - wp-admin.

      2 Guillermo

      http://www.airclic.com/?p=1297 will give you same link. so its exists. but its hidden somehow.

    • 07/07/10 12:48pm

      Oleg Butuzov says:

      sorry in this code typo

      if (isset($_COOKIE['BUTUZOV'])){

      can you replace it?

    • 07/07/10 1:44pm

      WP Answers says:

      header.php is updated. Sorry about the delay.

    • 07/07/10 1:59pm

      Oleg Butuzov says:

      results inside...

      here is query to db performed by query_posts...

      SELECT  distinct wp_posts.* 
      FROM wp_posts
      LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
      LEFT JOIN wp_term_taxonomy ON wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id
      WHERE 1=1 AND wp_posts.post_name = 'temporary-media-coverage-post'
      AND wp_posts.post_type = 'post' AND
      NOT EXISTS (
      SELECT *
      FROM wp_term_relationships
      JOIN wp_term_taxonomy ON wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id
      WHERE wp_term_relationships.object_id = wp_posts.ID
      AND wp_term_taxonomy.taxonomy = 'category'
      AND wp_term_taxonomy.term_id IN (9,1,6,4,12,11,5) )

      ORDER BY wp_posts.post_date DESC


      please take a look to the path of subquery witch is selecting posts that are not in some specific categories. for example category 12. witch is your posts in. something (perhaps plugin i did tell you about) changing sql to not select a posts in this categories. thats why it's not found.

  • avatar
    Last edited:
    07/07/10
    12:12pm
    Utkarsh Kukreti says:

    Link to site?

    • 07/07/10 12:15pm

      WP Answers says:

      http://www.airclic.com/news-resources/airclic-in-the-news-new

  • avatar
    Last edited:
    07/07/10
    12:40pm
    Guillermo Sornoza says:

    It sounds obvious, but have you try to recreate the post? If you see the "more" link, it points to

    http://www.airclic.com/temporary-media-coverage-post#more-1297


    And looks like you don't have a "temporary-media-coverage-post" named post.

    • 07/07/10 1:10pm

      WP Answers says:

      Hi,

      I just tried to re-create but still get a "Page Not Found" error after click read more

This question has expired.





Current status of this question: Completed