Tag Info

New answers tagged

0

I found the answer on Wordpress' website and have tested the solution: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule#Using_Custom_Templates_with_custom_querystring Create a Page Template Create a page template for stores and apply it to a page. $stores = get_query_var('stores'); Add a Rewrite Tag In your functions.php add a rewrite tag, ...


0

Please Note: Questions regarding 3rd-party plugins and themes are considered off-topic here at the WordPress Development SE. The best place to receive support for such items is the 3rd-party's official support channels. Please review the How to Ask section of our Help Center to learn more about what questions are on-topic and a good fit. ...


0

Alright, here to help :) If you find this helpful please share the bounty! Step 1: The Research My first hint was that these parts of the slugs are usually controlled by custom post type settings, thus I combed through the plugin files - finally finding that in the plugins in the file "class-wp-job-manager-post-types.php" inside the "Includes" folder on ...


3

The redirect is thanks to redirect_canonical() - we can simply swoop in with a filter and disable it for the front page: function wpse_184163_disable_canonical_front_page( $redirect ) { if ( is_page() && $front_page = get_option( 'page_on_front' ) ) { if ( is_page( $front_page ) ) $redirect = false; } return ...


1

I would use the add_rewrite_rule() function, please note that the code is untested but it should work depending on your specific use. If you also need to set a post_id, just add it to the index.php?p=X... string. function myplugin_filter_add_rewrite_rules() { // Allow for /myplugin/filter/someFilter add_rewrite_rule('myplugin/filter/([^/]+)/?$', ...


0

Think I have solved this. I have created the following template to change the url: $url = $current_user->display_name; $urlwithhyphens = str_replace(' ','-',$url); header( 'Location: http://www.example.com/author/'.$urlwithhyphens.'/?geodir_dashbord=true&stype=gd_place'); I was having trouble with usernames with spaces hence the new variable ...


0

If i have understood you correctly you just need your domain.com/home to display your homepage too? Just create this in a folder called home in the same folder as your /wp-content etc Name it index.php ?php header("Location: http://domain.com"); exit(); ?>


3

This approach should work for you: <?php /** * Plugin Name: Rewrite Shortcode **/ add_shortcode( 'myplugin', 'mp_shortcode' ); function mp_shortcode(){ return '<p>Filter: ' . get_query_var( 'filter' ) . '</p>'; } add_action( 'init', 'mp_rewrite' ); function mp_rewrite(){ $post_id = 2; add_rewrite_rule( ...


2

If you check out the output() method in the includes/admin/class-wp-job-manager-setup.php file, namely this part: /** * Output addons page */ public function output() { $step = ! empty( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; if ( 3 === $step && ! empty( $_POST ) ) { $create_pages = isset( ...


0

Here you can read an article about how to deal with. You'll have some mandatory things to do such rewrite your taxonomy with the same name of the custom post type. http://someweblog.com/wordpress-custom-taxonomy-with-same-slug-as-custom-post-type/


0

It seems that you might be creating a parent page for the wrong reasons. There are other classes that will be added to identify the current menu item and you can also change that behavior using a menu walker. The current menu item should have current-menu-item class added to it so you could leverage that in your CSS. Also in the menu setup instead of ...


1

a multi site approach wouldn't work since you will be creating multiple blogs, each will work as an individual WP installation, so each of them will hold multiple posts, pages, categories, etc that are not shared between blogs. The url you are proposing can't be defined using wordpress routing, so a custom code will need to be developed for this approach.


0

I offer following solution. It's required prepending this lines to index.php. if (!empty($_SERVER['REDIRECT_URL'])) { $_SERVER['REQUEST_URI'] = $_SERVER['REDIRECT_URL']; } I know this is a dirty hack, but WordPress rewrite mechanism based on $_SERVER['REQUEST_URI'] value. These rules tested only on links like (with another domain) ...


1

You can just look at url, load the file and exit. That can be done when WordPress loaded its environment, e.g. on 'init'. add_action('init', function() { $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH), '/'); if ( $url_path === 'retail' ) { // load the file if exists $load = locate_template('template-retail.php', true); ...


1

Use the add_attachment hook to update the slug after the attachment has been inserted: function wpse_182454_attachment_id_as_slug( $post_id ) { if ( get_post_field( 'post_name', $post_id ) != $post_id ) { wp_update_post( array( 'ID' => $post_id, 'post_name' => ( string ) $post_id, ) ...


0

This is probably not very trivial to do. You need to take into account that wordpress needs the "forums" directory in the url to successfully detect that the requested content is forum post and not regular posts or pages. Therefor you need to change the value of REQUEST_URI in the htaccess file or add your own URL parsing code. the path of least resistance ...


0

The rewrite rules are wrong. For example, you want to rewrite from community/tag/easter to 'index.php?pagename=community&stencil-tag=easter', so the regex should contain community/tag/ and not only tag/. Also, \d match only digits but the tag value is a string. Same apply to the rewrite for stencil-tag. You could use . to match any character, both ...


1

Use this plugin in wordpress and write rule which will overwrite nginx rule. https://wordpress.org/plugins/rewrite/ When you have wordpress, you have to set permalink to default to work your webserver rule work and if you dont want to do that you have to install above plugin and write rule.


0

Try this (untested): # BEGIN Forums Rewrite RewriteCond %{HTTP_HOST} !^www\.domain.com RewriteCond %{HTTP_HOST} ([^.]+)\.domain.com RewriteRule ^(.*)$ forums/%1 # END Forums Rewrite It should work with both your requirements. You don't need the second one (rewriting the forums folder to subdomain) because rewriting the actual forum ID will override the ...



Top 50 recent answers are included