Forum Replies Created

Viewing 15 replies - 1 through 15 (of 27 total)
  • Forum: Plugins
    In reply to: hard coding an sql query
    Thread Starter public_radio

    (@public_radio)

    Come on. this HAS to be a question that a number of you know the answer to. What is the deal?

    Thread Starter public_radio

    (@public_radio)

    ok guys, here’s what I’m going to do: In the case of the search results, I’m just going to hard query and pull the results. i’m trying to do that and I’m getting an error that says ‘unexpected T_STATIC’.

    here’s the query:


    SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE 1=1 AND (category_id = 3) AND ((post_status = "static" or post_status = "publish") OR post_author = 1 AND post_status != 'draft' AND post_status != 'static') AND post_status != "attachment" GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 10

    So is there too much in this query? all I want to do is pull my posts based on a certain category. What can I do here?

    Thread Starter public_radio

    (@public_radio)

    Ok so here’s the error:


    WordPress database error: [Column 'category_id' in where clause is ambiguous]
    SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) LEFT JOIN wp_post2cat ec3_post2cat ON ec3_post2cat.post_id=id LEFT JOIN wp_ec3_schedule ec3_sch ON ec3_sch.post_id=id AND ec3_sch.end>='2006-11-08 00:00:00' WHERE 1=1 AND (category_id = 3) AND post_date_gmt <= '2006-11-08 16:42:59' AND ((post_status = "static" or post_status = "publish") OR post_author = 1 AND post_status != 'draft' AND post_status != 'static') AND post_status != "attachment" AND (ec3_sch.post_id IS NOT NULL OR ec3_post2cat.category_id!=5) GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 10

    So the db request is including these:


    ec3_post2cat ON ec3_post2cat.post_id=id LEFT JOIN wp_ec3_schedule ec3_sch ON ec3_sch.post_id=id AND ec3_sch.end>='2006-11-08 00:00:00


    (ec3_sch.post_id IS NOT NULL OR ec3_post2cat.category_id!=5)

    and I don’t kno why it’s trying to include event calendar 3 (ec3) calls in there because these don’t pertain to the calendar at all.

    Thread Starter public_radio

    (@public_radio)

    Sorry that the title of this is incorrect. It should be WordPress eventcalendar3 db error.

    So check it out:

    https://dev.perspectivescs.org/

    Works fine. Then you go to search results:

    https://dev.perspectivescs.org/?s=another

    and the errors are back. I’ve tried everything, even copying over the code so the two pages, index.php and search.php, are identical. and I still get these errors. This is related to the eventcalendar3 plugin. maybe the s in the string is the culprit? I have no idea but I’m pulling my hair out.

    Thread Starter public_radio

    (@public_radio)

    Thank you very much, but these solutions didn’t work for the breadcrumb.

    I’ll tell you what did work, in case anyone wants to know:

    If you need to put a breadcrumb in the footer but the loops that precede it screw it up, call the breadcrumb once in the header, in a display:none div, then call it again at the footer. It seems to remember the results it extracted from the top.

    Thread Starter public_radio

    (@public_radio)

    I’m afraid i’m not getting anything from this article… I’ve tried clearing the post cache before breadcrumb(); but it doesn’t seem to do anything. There has to be a way to get breadcrumb(); to work properly.

    Let me show you what loops I’m using, paraphrased:


    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
    <?php endwhile; endif; ?>

    Loop2:


    <?php query_posts('cat=3'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_date('','<div class="urgentdate">','</div>'); ?>
    <?php the_content(__('&raquo;<span>&nbsp;</span>')); ?>
    <?php endwhile; endif; ?>

    Loop3:


    <?php query_posts('cat=4'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php the_excerpt_reloaded('100','<strong><img>'); ?>
    <?php endwhile; ?>

    …and in this order everything works (but if the first loop is last then it doesn’t work because the query_posts() don’t clear. And then there’s this:


    <?php breadcrumb(); ?>

    And this breadcrumb doesn’t work because of the query_posts() from the other loops. There has to be a way to reset this. It seemed like the multiple loops in that codex didn’t apply to this situation. Anyone?

    Forum: Plugins
    In reply to: more tags working on pages
    Thread Starter public_radio

    (@public_radio)

    I put this in front of the_content and I also put it in front of the if/while loop that precedes that, and it didn’t appear to change anything. The index still shows the more link and the pages still don’t.

    Forum: Plugins
    In reply to: more tags working on pages
    Thread Starter public_radio

    (@public_radio)

    right but i’m saying, I have a scrolling list of posts on the right for news, and i do need the tag to still work here. isn’t there something I can do to unsupress the more tag?

    Thread Starter public_radio

    (@public_radio)

    the newest event calendar 3 candidate release is bad. problem solved.

    Thread Starter public_radio

    (@public_radio)

    I disabled all the other plugins, and I also tried taking every db call off the page except one and i’m still getting a db error. so it has to be something with event calendar 3 being used on the index page.

    Thread Starter public_radio

    (@public_radio)

    ok, so i got the subpages to work too, by putting this in the loop:

    https://codex.www.ads-software.com/Template_Tags/wp_list_pages#List_Child_Pages


    <?php if(wp_list_pages("child_of=".$post->ID."&echo=0")) { ?>
    <ul>
    <?php wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order&show_date=modified&date_format=$date_format");?>
    </ul>
    <?php } ?>

    Thanks again for your help.

    Thread Starter public_radio

    (@public_radio)

    This is a big help, Kafkaesqui. Everything is working like a charm, except for the child pages.

    Thread Starter public_radio

    (@public_radio)

    ok I followed your advice and I think it worked, almost.

    sandwiched inside this code i have this:

    <?php wp_list_pages(); ?>

    which creates a loop within a loop, which is obviously wrong. However, it’s spitting out this loop 7 times which is consistant with the number of pages with the key I’m calling.

    Here’s another wrinkle: there are subpages under these pages. so the parent pages have a key and value and then those have child pages. I was hoping i could do something like <?php wp_list_pages(‘nav-level=topnav’); ?> but I guess I can’t. Suggestions? Thanks for responding.

    Thread Starter public_radio

    (@public_radio)

    ok, so all this:

    foreach($my_posts as $post) :

    I can leave the word posts in there and it knows i’m talking about pages?

    Thread Starter public_radio

    (@public_radio)

    OK, I’ve made some progress by using the get_archives function. I can get my archives to show up on the sidebar regardless of page; however, It’s only listing titles. I need it to list out a header, and the content of the post, like a normal blog.

    So: how do i use get_archives to show full posts? is this possible?

Viewing 15 replies - 1 through 15 (of 27 total)