Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter mmlog

    (@mmlog)

    Unfortunately I haven’t found a solution yet. What I got working is:

    $r = $wpdb->get_results(“SELECT SQL_CALC_FOUND_ROWS “.$wpdb->posts.”.* FROM “.$wpdb->posts.” WHERE 1=1 AND “.$wpdb->posts.”.post_type = ‘post’ AND (“.$wpdb->posts.”.post_status = ‘publish’) AND “.$wpdb->posts.”.post_date < ‘$post->post_date’ ORDER BY “.$wpdb->posts.”.post_date DESC LIMIT 0, $number”);

    which displays post older than the current one. But the goal is to only display post older then the current one of the same category.

    I have tried to extend the code like
    $r = $wpdb->get_results(“SELECT SQL_CALC_FOUND_ROWS “.$wpdb->posts.”.* FROM “.$wpdb->posts.” wposts
    LEFT JOIN $wpdb->postmeta wpostmeta ON wposts.ID = wpostmeta.post_id
    LEFT JOIN $wpdb->term_relationships ON (wposts.ID = $wpdb->term_relationships.object_id)
    LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
    WHERE 1=1 AND wposts
    .post_type = ‘post’ AND (wposts
    .post_status = ‘publish’) AND wposts
    .post_date < ‘$post->post_date’ ORDER BY wposts
    .post_date DESC LIMIT 0, $number”);

    (adapted from http://codex.ww.wp.xz.cn/Displaying_Posts_Using_a_Custom_Select_Query)

    but it does not work. Any help to get it working is much appreciate.

    I am also interessted in that code. Anyone out there who can provide it?

    Thread Starter mmlog

    (@mmlog)

    Hello Michael, thanks for your help. Unfortunately it does not work as I want. Probably my request was too vague. Sorry for that. I will use a sample trying to explain what I want to achieve.

    Lets says I have catagory1, there are 10 articles posted (latest created first):
    – article10
    – article9
    – article8
    – article7
    – article6
    – article5
    – article4
    – article3
    – article2
    – article1

    If the user is on article9, links to article 8, 7, 6, 5, 4 should be available. If the user is on article5 -> 5, 4, 3, 2, 1 should be available.

    Is this possible? I have read get_posts and WP_Query docu but did not find a clue. Any help much appreciated.

    Thread Starter mmlog

    (@mmlog)

    Unfortuately I haven’t find a solution for the issue yet. Maybe someone can jump into this thread with any further hint? Much appreciated.

    Thread Starter mmlog

    (@mmlog)

    Gangleri, thanks for your comment.

    I have to provide data from a third party (access via file system and database) on my website running with wordpress. Of course I want to use look & feel from the wordpress theme. So ‘data’ is no category nor a page within wordpress.

    My problem is: How to tell wordpress, if example.org/data/file1 (or anything else in the example.org/data/ tree) is browsed, that it does not should search for a wordpress category. But instead, it should process the code I am providing in /wp-content/themes/mytheme/data.php

    Any help much appreciated.

    Thread Starter mmlog

    (@mmlog)

    Thanks for you reply. I was afraid that this is a custom implementation. However, to make thinks easier, my plan is to make an own category for plugin, customize this category via the theme files and working with additional information via ‘Custom Fields’.

    Does this plan sounds bad? Any other suggestion to build a plugin directory?

    Forum: Plugins
    In reply to: Broadcast MU

    The same here. I have provided a fix at
    http://webstufflogging.com/wordpress/errors-and-warnings-from-broadcast-mu/

    Hope it helps.

Viewing 7 replies - 1 through 7 (of 7 total)