Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • blabbr

    (@blabbr)

    Hey the two of you!

    i experienced the exactly same problem.
    The problem seems to be that as soon as you have paged monthly or yearly archives, the plugin isn’t able to handle that.

    i had a look at the code and found this fix:

    IN THE FOLDER custom-post-type-archives IN THE FILE post-type-archives.php LOCATE THIS CODE:

    $custom_rules["$url_base($post_type)/([0-9]+)/([0-9]{1,2})/([0-9]{1,2})/?$"] = // enable listing by day
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . '&monthnum=' . $wp_rewrite->preg_index(3) . '&day=' . $wp_rewrite->preg_index(4);
    			$custom_rules["$url_base($post_type)/([0-9]+)/([0-9]{1,2})/?$"] = // enabled listing by month
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . '&monthnum=' . $wp_rewrite->preg_index(3);
    			$custom_rules["$url_base($post_type)/([0-9]+/?$)"] = // enable listing by year
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2);

    AND REPLACE ALL OF IT WITH THIS CODE

    $custom_rules["$url_base($post_type)/([0-9]{1,4})/([0-9]{1,2})/([0-9]{1,2})/page/([0-9]{1,})/?$"] = // ### FIX: enable listing by day + paging
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . '&monthnum=' . $wp_rewrite->preg_index(3) . '&day=' . $wp_rewrite->preg_index(4) . "&paged=" . $wp_rewrite->preg_index(5);
    			$custom_rules["$url_base($post_type)/([0-9]{1,4})/([0-9]{1,2})/([0-9]{1,2})/?$"] = // enable listing by day
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . '&monthnum=' . $wp_rewrite->preg_index(3) . '&day=' . $wp_rewrite->preg_index(4);
    			$custom_rules["$url_base($post_type)/([0-9]{1,4})/([0-9]{1,2})/page/([0-9]{1,})/?$"] = // ### FIX: enable listing by month + paging
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . '&monthnum=' . $wp_rewrite->preg_index(3) . "&paged=" . $wp_rewrite->preg_index(4);
    			$custom_rules["$url_base($post_type)/([0-9]{1,4})/([0-9]{1,2})/?$"] = // enabled listing by month
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . '&monthnum=' . $wp_rewrite->preg_index(3);
    			$custom_rules["$url_base($post_type)/([0-9]{1,4})/page/([0-9]{1,})/?$"] = // ### FIX: enable listing by year + paging
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2) . "&paged=" . $wp_rewrite->preg_index(3);
    			$custom_rules["$url_base($post_type)/([0-9]{1,4})/?$"] = // enable listing by year
    				"index.php?post_type_index=1&post_type=$post_type_slug&year=" . $wp_rewrite->preg_index(2);

    NOW NOTE THIS:
    – after doing this you have to update your permalinks
    – i don’t give you a guarantee that this will work – it won’t break something major though ??
    – only works if you use rewrite slugs from the plugin’s options (haven’t looked into not using slugs…)
    – brought to you by https://www.kition.net ??
    – i’ve only tested it for the yearly archives because i don’t have monthly or daily archives big enough to be paginated (and i don’t feel like creating some pages right now…)

    hope it works for you guys! if not, drop a line, i might be able to help out…

    cheers, phil

    Forum: Plugins
    In reply to: Cloning a WordPress Plugin
    Thread Starter blabbr

    (@blabbr)

    Hmm, I’m afraid, it’s not that easy … (or it is and I just can’t do it)

    anyways: I made a copy of the WPG2-plugin folder. Then I tried activating the plugin in the admin panel, but then of course the expected php error came about: it couldn’t redeclare a function previously defined by the original plugin.

    So – would I need to rename all the functions?
    And – what do you exactly mean by “edit its header information”? Where can this “header information” be found?

    Thanks anyway for your help.

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