Tag Info

New answers tagged

0

No, that is correct, news has nothing to do with your structure... it's just a word... But you can get a way around it... you could copy archive.php and name it something like template-news.php then edit the template-archive.php... put this at the top... just below ' <?php /* * Template Name: News */ Then add a new page in your dashboard... make ...


0

This is about a year over due. I have had a similar thing happen on my new word press install. Creating pages dynamically and getting incremental numbers on the slug names. During this process I realised that the original slug would access the last one. ie. ../../dynammic-page would access ../../dynamic-page-4 The solution was in the trash folder! ...


2

You can use sanitize_title() function: $string = "This is title string"; // return "this-is-title-string" $slug = sanitize_title( $string ); You can also filter the result of sanitize_title() function using sanitize_title filter: add_filter( 'sanitize_title' , 'sanitize_filter_callback', 10, 3 ); function sanitize_filter_callback( $title, $raw_title, ...


1

I wouldn't call it a bug, you haven't done anything to place that restriction on the query for your post. It also seems like a fairly unlikely case where random strings will end up in place of your taxonomy terms for this to even present itself. Anyway, the answer is to modify the query via pre_get_posts to add in whatever taxonomy data you need. I don't ...


0

When I need a custom php page that works with Wordpress, generally I do this: I add a query variable to variables permitted by Wordpress: add_filter( 'query_vars', 'myplugin_add_query_var' ); function myplugin_add_query_var( $query_vars ){ $query_vars[] = 'myplugin_page_name'; } I add a function to parse_request action that check if is set the ...


-1

You can create a custom post type with register_post_type() function with false as show_ui parameter like this. //code is taken from codex //custom post type name is book here. Change the post type name and other options as your need //Set `show_ui` and `show_in_menu` false add_action( 'init', 'codex_book_init' ); function codex_book_init() { $labels = ...


0

Well, inside your directory just keep a normal php file like my-page.php, and then create a vanity URL for it using .htaccess. Open your .htaccess file (if present in the nstallation directory) or create one RewriteEngine On RewriteRule ^my-page-slug my-page.php Should be good update if you want to access WP posts and other objects, you must include ...


0

Im not sure what your asking, but I couldn't figure out how to format the permalinks for my custom post type and found this plugin which gives you some options for easy customization Custom Post Type Permalinks



Top 50 recent answers are included