• daiver

    (@daiver)


    I’m having two problems at the moment since I modified my Word Press.

    1) I’d like to know how WP knows when I’ve written something and set the post date to the future so that it goes public at that exact same time. For example, if I want something displayed tomorrow at noon, I’d edit the timestamp to tomorrow and set the time, then hit PUBLISH. This makes that entry appear on the front page at that exact time. Where does WP store this information? What is the table that holds the variable? Does this variable get switched automatically once the date is met?

    2) My RSS has disappeared. I go to https://www.pornsentinel.com/rss [NSFW] and I get nothing. So then I remembered that I haven’t set up htaccess yet, so I type in https://www.pornsentinel.com/rss.php and I get nothing. I’ve modified the layout of my blog and how the information is displayed, but WP code is all exactly the same, so I don’t know where my RSS went. How can I solve it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Kafkaesqui

    (@kafkaesqui)

    1. There’s no special variable that tells WordPress when a post should be displayed. A standard posts query checks the time/date on posts, only collecting those with a timestamp that matches *now* or any date past. Future-dated posts are not collected by such a query.

    2. I’m not sure I can provide an answer. First, you don’t appear to be using custom permalinks, which would allow something like:

    /feed/rss2

    But mainly, you don’t appear to be using any form of permalink I’m aware of for WordPress. For example:

    index.php?accion=review&post_id=242

    Is a link to a recent post, but WordPress does not provide an ‘accion’ GET key (unless this is a localization option I’m unaware of), nor is there a ‘post_id’ one (‘p’ is used to call up posts by ID).

    So, is this a WordPress site we’re looking at?

    Thread Starter daiver

    (@daiver)

    “So, is this a WordPress site we’re looking at?”

    Yes, heavily customized though, but I am running WordPress as a backend for it. There are some other things handled by other scripts, but the majority of the site is WP. Basically it is a php file calling stuff off the database, hence the strange URLS. I’m also working on those URLs for SEO. They will be handled via htaccess once I change the way it pulls up posts from post_id to post_name. After that, SEO can be resolved with about two lines of htaccess/mod_rewrite.

    Can you please tell me what is the query that checks the time of the post?

    Kafkaesqui

    (@kafkaesqui)

    Can you please tell me what is the query that checks the time of the post?

    If you’re asking how this is performed in a query, typically the code would look something like:

    $now = current_time('mysql');
    $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_date <= '$now'");

    This uses the internal WP function current_time(), with the argument ‘mysql’ making sure the timestamp format is in the MySQL DATETIME format. Note the example query is bare bones, in that it doesn’t make sure we’re selecting just posts, or limiting the number of records (posts) collected, etc.

    Thread Starter daiver

    (@daiver)

    Thanks, I will look into it then =)

    Any thoughts on the RSS?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘RSS and quick table question’ is closed to new replies.