Tag Info

New answers tagged

2

All you need is to enable permalinks. I strongly recommend switching to permalinks: /%postname%/ The old links will still work. (In fact, every single permalink type is just an alias for the default one: ?p=%post_id% ). Being able to give people easier to remember links to pages is a secondary reason. The main one should be boosting page rankings in ...


1

If you tried to create a static file and then load it like a normal file, you may have had trouble because a WP page as we call it, is actually not actually 1 file, but rather a lot of files that tell Wordpress how to put together information queried from the database based on the query that is used in the URL. Most modern WP installs use pretty-links which ...


2

you sad u have access to phpmyadmin. Go to it, find wp_options table Look for custom_wpadmin_slug in option_name and in option_value column will be your's custom defined wp-admin slug If you'll still wount be able to access then remove next lines in .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^{your_wp_admin_slug}/?$ ...


0

Yes it is possible. One part of my question is answered here and full code I will type here. I have larger function wich checkes post taxanomy (in this case custom categories for custom post type). Then we check is there particular taxonomy and we change URL structure. add_filter('post_type_link', 'replace_link', 1, 3); function replace_link( $link, $post ...


0

In general the pretty permalinks are domain of Rewrite API in WordPress. But they convert the links into query variables for backā€“end PHP side of it. Hashbang links are domain of JavaScript. It is impossible to say how easy would be to change them, without very specific knowledge of how theme's JS implements them.


0

I would strongly suggest leaving IIS alone and implement your requirements in WordPress: /** * Remove category base from "newcat" permalink. * * @param string $link * @param object $term * @return string */ function wpse_175424_term_link( $link, $term ) { if ( $term->taxonomy === 'category' && $term->slug === 'newcat' ) ...


0

I hope you are still interested in this question. I did a sub domain mapping to a custom post type using custom .htaccess setting. RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^(.+)\.domain-name\.com$ RewriteRule ^$ /index.php?store=%1 [L] Using this setting, each sub domain will map to the store custom post type. http://apple.domain-name.com ...


1

So after a lot of time spent and a lot of trying different things, I finally figured out the right way to do this. I used MonkeyMan Rewrite Analyzer and the WP Debug Bar to help figure out how to construct the rewrite. So first, my custom post type URLs are rewritten as such: // Artist Rewrite Args $rewrite = array( 'slug' => 'artist', ...


0

I'd better post a comment, but I cannot for now. Your code works perfectly, but if you do not want to break the per category RSS feeds it should look like this: add_action( 'init', 'wpa58471_category_base' ); function wpa58471_category_base() { // Remember to flush the rules once manually after you added this code! add_rewrite_rule( // The regex to ...


0

The problem with calling flush_rewrite_rules() is that the rules instantly get regenerated, while your plugin's hooks are still active. What I usually do, because it's the simplest route to success, is delete the rewrite_rules option on activation/deactivation. The rules will then get regenerated on the next pageload instead of the current one: ...


0

Just got a solution: Just add this code to your functions.php and replace '_metainfo' by your meta information and 'posttype' by your posttype. function add_meta2url( $link, $post ) { $post_meta = get_post_meta( $post->ID, '_metainfo', true ); if ( 'posttype' == get_post_type( $post ) ) { $link = $link . '#' .$post_meta; return ...


0

As I understand your Question, you need to hook into most of the Link Filters (which are listed here: http://codex.wordpress.org/Plugin_API/Filter_Reference#Link_Filters ) and then add the query to them if the queryvar "clean" is set. Happy Coding, Kuchenundkakao


0

First, year is already a WordPress query var used for date-based archives, you should change that to something unique to prevent possible conflicts. To use your own query vars within rewrite rules, you need to add them to the list of known vars: function wpd_query_vars( $qvars ) { $qvars[] = 'my_year'; $qvars[] = 'make'; $qvars[] = 'model'; return ...


0

For the sake of anyone interested in the answer to this question, I am posting here the following answer that I received in the WordPress.org support forums. leejosepho graciously provided the following answer: Yes, that is possible. Save 'http://dem0site.net' in both boxes at Dashboard > Settings > General, then cPanel-assign and -point your domain to ...


0

Finally figured it out. 1) I was calling the first function at 'rewrite_rules_array' instead of 'init' which was just dumb. 2) There was still something wrong with it, but I explored another area that seems obvious now, but which I originally glossed over because it seemed to be. https://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint ...


0

It seems to be redirected to "http://www.zeekray.com/en/" . But you don't have a folder like "/en", as far as I can see here http://www.zeekray.com , where the folders are shown.


0

Admittedly a clever solution, and one that works fine within the scope of your original question. For future readers with similar use cases' reference though I would suggest they also consider creating a multisite (network) install. When used purely for sub domain sites (ie no domain mapping) it's not greatly more difficult to create and manage than a ...


0

Thanks @cybmeta for your hint. I searched my theme and found an other flush_rewrite_rules(true); on the init hook. I removed this and now the rule is being remembered. Seemingly, calling the function twice is breaking something. Doesn't really make sense to me, but it works now, so whatever :)


0

wp-config.php if ( is_alt_domain( $_SERVER['SERVER_NAME'] ) ) { $domain = str_replace( 'www.', '', $_SERVER['SERVER_NAME'] ); define( 'WP_SITEURL', 'http://www.' . $domain ); define( 'WP_HOME', 'http://www.' . $domain ); } else if (is_sub_domain( $_SERVER['HTTP_HOST'] ) ) { $domain = "{$_SERVER['HTTP_HOST']}"; define( 'WP_SITEURL', ...


0

The best way to achieve content separation between sites is to separate their DBs. As a rule of thumb it is easier to aggregate content the separate it, search, RSS feeds, social sharing, SEO might need to behave differently on different subdomain, and there is no way the kids will agree to the design imposed by the "old guys". The easiest solution is to ...


1

Is there some reason you need subdomains over "subdirectories" (I put that in quotes because it won't actually be a real subdir... read on)? This would be much easier if you wanted to go with family.com/me, family.com/her, family.com/project1, etc... Going this route, you could create page templates that have custom loops in them using WP_Query and assign ...


0

I'll preface this by saying I think it makes much more sense to have play appended to the end of the permalink, which you could easily achieve with add_rewrite_endpoint, but in the interest of answering the question as it was asked... First you'll need to add a query var that you'll later check to know when to load your other template: function ...


0

Add a hidden input field to your form with name page and value my-wordpress-plugin, When the form is submitted it will be passed along with your other form data. <input type="hidden" name="page" value="my-wordpress-plugin">


0

template_redirect is an action, it expects nothing to return back. What you are looking for is template_include filter I think. http://codex.wordpress.org/Plugin_API/Filter_Reference/template_include


0

You can use a slug, when you are registering the post type with register_post_type(). You can add this argument like this $labels = array( //... add the labels as you need ) ); $args = array( 'labels' => $labels, //add other options as you need 'rewrite' => array('slug' => 'view-promotion') ); ...



Top 50 recent answers are included