Tag Info

New answers tagged

0

Have you tried adding the third parameter to that call? add_rewrite_tag( '%make%', '([^/]+)', 'make=' );


0

This rewrite rule will surely work. Add this code to your .htaccess file. RewriteEngine On RewriteRule ^uni/([^/]*)$ /gallery/?university=$1 [L]


0

I needed to reset the permalink setting to Default, then change it back to the custom structure I was using. This apparently resets it.


0

Ok. Then you can use template_redirect hook and wp_is_mobile() conditional tag. wp_is_mobile() will work on device only. If you resize the window then it will not work. Now you can try this kind of code in your functions.php file add_action('template_redirect', 'redirecting_to_mobile_site'); function redirecting_to_mobile_site(){ if( wp_is_mobile() ){ ...


2

I'm not sure but I think that you just need to add two query vars, "group" and "value", not two rewrite tags. Can you try this: add_filter('query_vars', 'cyb_add_query_vars'); function cyb_add_query_vars( $vars) { $vars[] = "group"; // name of the var as seen in the query string and URL $vars[] = "value"; return $vars; } ...


1

When you register the post type, set the argument 'has_archive' to a string, in your case plugins. The doc block for register_post_type() says: @type bool|string $has_archive Whether there should be post type archives, or if a string, the archive slug to use. Will generate the proper rewrite rules if $rewrite is enabled. Default false. Minified ...


0

I wrote an article a while ago on how to do this using Bit.ly and a custom url. http://craigmdennis.com/articles/set-up-a-custom-short-url-with-wordpress Buy a short URL Sign up for bit.ly Add an A Record to point to bit.ly and verify it Download & install bit.ly Service WordPress plugin Use <?php echo wp_get_shortlink(); ?> in your theme As ...


0

Here's a possibly simple solution, using an ancillary table, and user-defined short slugs: create a post_meta "short_slug" when creating a post, the link-name from your example on save_post, if (meta_key='short_slug' and is_a_valid(meta_value)) wpdb->insert into short_slugs_table slug,permalink , your index.php on your mgscr.com could then ...


0

Please note that if you have lessons that are in multiple chapters you will create duplicate content. If you want an easy way to connect these post types you can use a free plugin called Post Connector: http://wordpress.org/plugins/post-connector/


0

Try this : function change_post_type_link( $link, $post = 0 ){ if ( $post->post_type == 'questions' ){ return home_url( 'questions/'. $post->post_name .'/'. $post->ID ); } else { return $link; } } add_action( 'init', 'change_rewrites_init' ); function change_rewrites_init(){ add_rewrite_rule( ...


0

I made modification of rules, now it is working fine. #For post page URLs RewriteRule ^(.*)-some-category-suffix(.*)-some-category-suffix(.*).jpg.html(.*)$ /category-url/$1$2$3.html [L,R=301] #For post add-on page URLs RewriteRule ^(.*)full-size/(.*)-some-category-suffix(.*)-some-category-suffix(.*).jpg-(.*)(.*).html$ /category-url/$1$2$3$4.html?-$5$6 ...


0

Nilambar's comment solved this for me. "You can pass two values as comma separated in a single parameter events. And later parse value correctly in your page. – Nilambar" I use this to get posts with tag1 OR tag2: echo '<a href="'.esc_attr(add_query_arg( 'events', 'tag1,tag2')).'">Linkname</a>'; And to get all posts with tag1 AND ...


3

Yes, it is possible. WordPress frontend workflow can be summarized like so: A url is visited By checking current url against all the defaults and custom rewrite rules the url is "converted" to a set of arguments for WP_Query. This is done by the parse_request method of an instance of the WP class stored in the global $wp variable An instance of WP_Query ...


1

If you have access to your database you can run the following query. I had run into a similar issue a while back. UPDATE wp_posts SET post_name = REPLACE(post_name, '---', '-') This will bulk replace every '---' with a single '-' in the post_name. It may also be wise to run the same command on the 'guid' field. Perhaps someone has a better solution, but ...


0

about the permalinks you should go to settings->permalinks and change permalinks to "post name". then you can see "/blog/" for your blog page. for translating your theme you dont need any plugins. you should work with .po files. go to your theme folder and then "languages". there you can see translation files inside this folder. you can create your own ...


0

Hi Mark Kaplun and toscho, thank you for replying. I've figured out the culprit, it was caused by W3 Total Cache Plugin setting. Under Browser Cache, I have to untick this: Prevent caching of objects after settings change The weird string before every links is then removed.


0

If you need to add query string arguments to permalinks, use the_permalink filter: function append_query_string( $url ) { return add_query_arg( 'id', 'something', $url ); } add_filter( 'the_permalink', 'append_query_string' );



Top 50 recent answers are included