Articles of permalinks

Access or edit custom generated permalinks with WP_Rewrite

I want to create custom permalinks for my plugin using WP_Rewrite. I found the codex the have great examples and this stack topic also explained a lot to me. Currently I’ve got the following code based on the codex and update 3 from the stack overflow question: add_filter( ‘rewrite_rules_array’, ‘custom_permalinks’ ); add_filter( ‘query_vars’, ‘custom_query_vars’ ); […]

Permalinks not working in WordPress

In wordpress I’ve chosen “Day and name” for permanlinks but I am getting 404. The modrewrite module is loaded, the .htaccess is -rwxrwxrwx 1 www-data www-data 274 nov. 23 13:10 .htaccess i have put htaccess to 777 temporarily just to solve the problem but still it doesn’t work any suggestion ?

Get Posts Based on Tag Matching Page Title

I have the following written to retrieve a list of posts that match the title of the page, by their tag. The problem is it does not play nicely with tags that have multiple words (and perhaps special characters too but I have yet to run into that). <?php $title_post_tag = new WP_Query( array( ‘tag’ […]

Rewrite URL Parameter And Force 'Pretty' Permalink

I’m trying to pass a variable via a URL parameter and rewrite + force ‘redirect’ it. In other words, I have: /dir1/dir2/?my_var=123 and I want: /dir1/dir2/123/ Through the following code in my functions.php file, I am able to achieve that: function setup_filter_rewrites() { add_rewrite_rule(‘dir1/dir2/([^/]*)/?’, ‘index.php?pagename=dir1/dir2&my_var=$matches[1]’, ‘top’); } add_action( ‘init’, ‘setup_filter_rewrites’ ); function setup_filter_query_vars( $query_vars ) […]

Redirect User From Registration Page To CPT (profile page) with custom url

I am looking for a little advice regarding wp_redirect after successful registration, the plan is a new user registers and is then re-directed on success to a custom post type page ‘Agent’ wp stackexchange question asked here two years ago. The agent page is a profile page containing info entered entered at registration and will […]

WordPress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options

How do I modify the Settings > Permalinks (options-permalink.php) admin page to add more custom permalink parameters? I’d like to add additional permalink parameters to the “Optional” section for custom taxonomies that I’ve created. Specifically, I’d like to add more base prefix options for the Custom Taxonomies that I created. The custom taxonomies are named […]

Getting an ID from a URL, why can WP do this itself, but none of of the functions provided get it right?

I have a set of absolute URLs that have been used to refer to my site (they come from redirects in an old .htaccess file in this case). All of these URLs do resolve to some page or post on the site. In other words, when I use them in my browser, they work. Many […]

All my posts don't show, only the headline is displayed on the homepage

I’m new to WordPress. I host my site on GoDaddy. Last night, all my posts stopped showing when clicked. Works fine on homepage, but when clicked it would respond “Error 404″… Please Help me out! My Pages work fine… My site is

Custom rewrite rule for hierarchical custom post type

Working on a client site I’ve encounter my worst enemy… WP URL rewrite :(. I actually can’t figure it out and after many days trying and searching, I can’t make it work. What I’m trying to get is a permalink like this regardless of the /parent/child/ nesting depth. I do need the functionalities of […]

404 with post name permalinks

So, I have a pretty common problem – I recently upgraded to Ubuntu Trusty Tahr from Precise, and I had to upgrade apache as a result. Now, my wordpress site is accessible, but I am unable to access any pages within my wordpress site. So, for example, works fine, but gives a 404 […]