Permalink format: singular or plural

There’s a simple rule that I follow (it’s hard to explain, so I’ll give examples): http://example.com/categories/ <– This plural form should mean that the page shows a list of all the categories in use on your site. Similarly, if it’s “authors” (as in http://example.com/authors/), I’d expect the page to show a list (with or without … Read more

Performance of my permalink structure?

You can check by looking at the size of the rewrite_rules option in the database. If it’s small (which I believe it should with this structure), you’re not using verbose rules. By contrast, if you see several lines per static page, you’re using verbose rules and it’s not good.

Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?

The best place to flush rewrite rules is on plugin activation/deactivation. function myplugin_activate() { // register taxonomies/post types here flush_rewrite_rules(); } register_activation_hook( __FILE__, ‘myplugin_activate’ ); function myplugin_deactivate() { flush_rewrite_rules(); } register_deactivation_hook( __FILE__, ‘myplugin_deactivate’ ); See the codex article Apologies in advance, I didn’t make it all the way through your question, so this is a … Read more

Why is “/page/2/” not working?

Found the answer: After a looong day debugging thru wordpress core, I managed to solve this issue. Basicly, you CANT have a PAGE and a CUSTOM POST TYPE with the same name. If you do, the permalink rewrite rules will get confused and trigger a 404. A very simple solution I’m using is: The page … Read more

Get default permalink structure from pretty URL’s

First of all I have to say that wp_get_referer() is not 100% reliable because it relies on $_SERVER[‘HTTP_REFERER’] that is not 100% reliable, from php.net docs: The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set … Read more

Get the current page URL (including pagination)

In addition to Rajeev Vyas’s answer, you don’t need to pass any non-empty parameters to add_query_arg(). The following has always worked well for me: // relative current URI: $current_rel_uri = add_query_arg( NULL, NULL ); // absolute current URI (on single site): $current_uri = home_url( add_query_arg( NULL, NULL ) ); The function falls back on $_SERVER[ … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş