Rewrite Custom Post Type URL slug

If the city and region is always city and region strings, you can do something like this. For your specific case, you could do it like this: ‘rewrite’ => array( ‘slug’ => ‘city/region/event’ ), ‘hierarchical’ => true, ‘has_archive’ => false, ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘page-attributes’), If the city becomes some city and the … Read more

Multiple domain names for one site

What you’re trying to do is called Domain Masking. There are several ways to achieve this, but they are not easy. There is a plugin in the repo that seems to be able to do content masking right from within the dashboard, but I have never tested it. My initial intuition would be to do … Read more

Using a _GET gives me a debug error (over my head)

The error is occurring as the $_GET array doesn’t have the item $_GET[‘do’] in it. Therefore it throws this notice. To check if something exisits in the array try: if( isset( $_GET[‘do’] ) ) $do_that = $_GET[‘do’]; else $do_that=””; or a cleaner method would be to use short hand notation $do_that = ( isset( $_GET[‘do’] … Read more

display URL or permalink instead of page title in dashboard

Filter ‘the_title’ on the screen with the list table of your post type. The pattern for the initial hook is: manage_edit-post_type_name_columns. Sample code: // replace ‘post’ with the post type name you want to catch. add_filter( ‘manage_edit-post_columns’, ‘wpse_67171_title_to_url’ ); /** * Replace the default title with its permalink. * * @param string $title * @param … Read more

Use image url with add_image_size

The pattern you posted… www.mydomain.com/image.jpg(‘custom-thumb’); … is a bit odd. That would be pretty tricky. You’d need a PHP handler to load the image and you’d need to tell the server (Apache, Nginx, IIS, Whatever) to parse that file ending as PHP. Something like this would be simpler: www.mydomain.com/image.php?size=custom-thumb You would still need to create … Read more

base directories / URL

You can manually create pages named category and app in admin under the Pages menu, and use a custom page template for each to list out taxonomy terms or whatever you need. EDIT – 301 redirect a request that matches the pagename rewrite to another page: function wpa_parse_query( $query ){ if( isset( $query->query_vars[‘pagename’] ) && … Read more