Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author sparkweb

    (@sparkweb)

    Noted. I will consider this for a future version. Thank you,

    Thread Starter Chito

    (@chitaranjanthoudam)

    @sparkweb

    Thanks for considering for future version, is there any plan to update soon? I have 31K post and not able to use this plugin as I will get out of memmory error. I did it for all post sometime back using sql in myphpadmin, I like update the post for about a month, so wonder when this feature will be added.

    Thanks once again for looking into this matter.

    Plugin Author sparkweb

    (@sparkweb)

    I have added this feature for you. I’ve also limited the default number of posts per page to 200.

    The repo FAQ hasn’t updated yet, but please download version 1.8. Here’s the docs:

    This plugin will run into memory problems and not submit properly if there are too many posts on a page. Currently the page limit is set at 200. To show more or less on a page, just add “posts_per_page=10” to the querystring to display only 10 posts. Use the querystring page_number=X to display a certain page.

    Search for a date range by entering a search query with “..” between the dates. So if you wanted to search for all dates between 2014-01-01 and 2014-02-01 you would search for “2014-01-01..2014-02-01”. Or search for “2014-01-01..” to search for all orders between 2014-01-01 and the current date. Or search from the beginning of time until 2010-01-01 by searching “..2010-01-01”.

    Thread Starter Chito

    (@chitaranjanthoudam)

    A big thank you, it is working perfectly..

    Thread Starter Chito

    (@chitaranjanthoudam)

    Probably one more request, can we have some custom fields to add automatically whenever any new post is created…may be include in setting.

    Plugin Author sparkweb

    (@sparkweb)

    Glad that worked for you.

    This is outside the scope of what I’d like to do with the plugin, but this kind of thing could be very easily accomplished with just a bit of code. I worked this up and it should do the trick:

    add_action("wp_insert_post", "my_insert_function");
    function my_insert_function($post_id) {
    	if (!get_post_meta($post_id, "My Field Name")) {
    		add_post_meta($post_id, "My Field Name", "My Value");
    	}
    	if (!get_post_meta($post_id, "My Field Name2")) {
    		add_post_meta($post_id, "My Field Name2", "My Value2");
    	}
    }
    Thread Starter Chito

    (@chitaranjanthoudam)

    Thanks for the quick response, just wondering where this code will go, is it in theme function.php or plugin php?

    Plugin Author sparkweb

    (@sparkweb)

    Just put it in your theme’s functions.php file. Inside the <?php tag so it gets processed as PHP.

    Thread Starter Chito

    (@chitaranjanthoudam)

    I have changed from add_post_meta to update_post_meta and added to theme function because add_post_meta was pulling twice when I hit publish post. Everything is happening as expected except one thing for allegro_breaking_slider, “breaking-news” is my category slug if I use this then post_meta is storing as “breaking-news” and nothing show up in the post. I checked a post which I have selected category as “Breaking News” from the drop-down, that has been stored as a:1:{i:0;s:4:”6701″;} as meta_value (6701 is the category id). Wondering how I can make the table to get that value, probably I will try some more options.

    Thanks again for helping me…

    add_action(“wp_insert_post”, “my_insert_function”);
    function my_insert_function($post_id) {
    if (!get_post_meta($post_id, “allegro_breaking_post”)) {
    update_post_meta($post_id, “allegro_breaking_post”, “show”);
    }
    if (!get_post_meta($post_id, “allegro_breaking_slider”)) {
    update_post_meta($post_id, “allegro_breaking_slider”, “breaking-news”);
    }
    if (!get_post_meta($post_id, “allegro_sidebar_position_small”)) {
    update_post_meta($post_id, “allegro_sidebar_position_small”, “left”);
    }
    if (!get_post_meta($post_id, “allegro_sidebar_select_small”)) {
    update_post_meta($post_id, “allegro_sidebar_select_small”, “default-left-sidebar”);
    }
    }

    Plugin Author sparkweb

    (@sparkweb)

    I didn’t do update_post_meta() because that was updating it every time. I had the IF check to make sure one hadn’t been added first. Not sure why it’s doing that — it certainly wasn’t on my test install. Good luck….

    Thread Starter Chito

    (@chitaranjanthoudam)

    Hi David,
    I might have to ask one more question related to this, my theme has two post type, one is “post” and another one is “gallery”. How can I restrict this only to post_type==”post”.

    Thanks for your help.

    Plugin Author sparkweb

    (@sparkweb)

    You could try something like

    if (get_post_type($post_id) == "post") {
    ...
    }
    Thread Starter Chito

    (@chitaranjanthoudam)

    thanks thanks thanks!

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

The topic ‘Feature request to add filter by date’ is closed to new replies.