Permalink of some posts change

Are your rewrite rules wrapped in <IfModule> tags? Should look like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress

WordPress rewrite url help needed

You can edit the permalink properties in www.url.com/wp-admin/options-permalink.php, without editing your .htaccess file. You can choose the last option and add there the “city name” you need.

How to show main category related to that post

There are better suited functions to do what you want available. In reference to your other, similar question, use get_the_category() like you did there. Or you can use get_categories() or wp_list_categories(). What to chose depends on your needs, for example in regards to formatting. Btw, the question, what the main category is isn’t as easy … Read more

Authentication over CURL

I figured out the answer myself and I’ll post it here in case anyone else has this problem. Basically in WP 3.9.1, wp_insert_post() checks the current logged in user for account capabilities (at least this is what I assume). Since I was connecting over cURL, there is no logged in user so the capability checks … Read more

$post->ID not working

Your WP_Query loop is incomplete. Your not checking if any posts were actually found before looping, nor are you presenting a message to show none were found, nor are you cleaning up afterwards. You’re also using the ‘other’ syntax that breaks brace matching in IDEs, making your life harder. Try adding global $post; like this: … Read more