Tag Info

New answers tagged

0

Can you try this? $paged = (get_query_var('page')) ? get_query_var('page') : 1;


0

As Mark explained, you will need to return $newvar. That should work. Also, please reset the permalink once. (I mean, go to Permalinks section in dashboard and click 'Save changes' button without making any changes. It will flush rewrite rules and build them again.) If it still does not work, then I think below snippet may help. Check if that works. I ...


0

Option 1 Setting your Permalink structure is actually writing the chosen rules to your .HTACCESS file, so once you have your desired permalink structure set, change permissions for your .HTACCESS file back to 644 so that the file is no longer writable. This will prevent any changes being made to the file even if new settings are updated via your dashboard. ...


0

Should be as simple as this: add_filter('pre_update_option_permalink_structure', 'my_chgcb'); function my_chgcb($newval, $oldval) { return $oldval; } This disables any changes to the permalink setting. You can additionally hide it using CSS.


0

Yes, it is possible. You have two options. First, change the folder where your domain goes. If I get it correctly, now, your domain goes to the root folder. You have to change it, and make it goes to the blog folder. The second option, is move all files that are inside blog folder to the root folder. When you did any of these option, you won't be able ...


0

Option 1 This is the clean way using .htaccess. Put this at the top of your .htaccess: <IfModule mod_alias.c> RedirectMatch 301 /portal/wp-content/uploads/(.*) /wp-content/uploads/$1 </IfModule> Option 2 This is a bit brute-force and I therefore wouldn't recommend it, but I include it here for completeness. Just copy all files in ...


0

Could be directory permission issues. You can update your website manually. Here are the step by step instructions. http://codex.wordpress.org/Upgrading_WordPress_Extended


0

It is not possible by default. Your only possible way out of this is to create custom page templates which you can modify to display something like an index or any custom content When you create a new page in the back-end, choose this custom template, and make sure that your page slugs is named accordingly so that when you visit domain.com/category/ ...


0

Add that to your functions.php: function wp_link_query_mod ( $results ){ if( count( $results ) ){ for( $i=0; $i<count($results); $i++ ){ $results[$i]['permalink'] = wp_get_shortlink( $results[$i]['ID'] ); } } return $results; } add_filter('wp_link_query', 'wp_link_query_mod'); This hook is only usable since WP ...


0

yes, use the redirection plugin. redirect all traffic from blog.mysite.com to mysite.com and use the plugin for a second redirect to the actual page. After you moved the site and change the htacess run a crawler on mysite.com and fix the 404 errors that you will see.


-1

The quickest and most hassle-free way is to download the database via phpMyAdmin, do a search and replace on the domain name and then re-upload the database. Good luck!


0

WP allows you to add custom rewrite rules via WP_Rewrite - using them you can achieve pretty much anything you want - and if you like RegEx it will be a breeze. WordPress needs triggers by which it will recognize the type of page you are requesting, hence it's default /category/ match rule along with many others. You can see all the current rewrite rules ...


1

This is a typical issue when moving WordPress sites. WordPress stores URLs - both main configuration URLs and resource URLs - in the database. These must be changed in the database when moving to a new domain or mail URL in localhost. Don't use simple SQL change queries in the database via adminer or phpmyadmin. WordPress and some themes store ...


-2

The reason that you're being redirected from site2 to site1 is because you imported an SQL dump for site2, which's values are still for site1 To clarify, you probably have exported the database from site1, and you imported the SQL dump from site1 to the database from site2. The values for site2 are the same as the ones from site1, so also the URL, hence why ...


0

Hmmmm.... I'm not sure this is possible since the fairs are not located under the "past fairs" CPT. However, the URL structure shouldn't be too critical as long as the navigation on your site is setup in a way that makes sense. Is there any other reason you want this behavior other than personal preference?


0

I tried it locally with the permalink setting /%category%/%postname%.php which worked, I have not tested beyond that other than seeing if the other sites open up and they do, but I have a feeling there must be a less hackey way to achieve this.


0

You could use the NOINDEX, FOLLOW meta robots tag on the this 'stack' page, or the individual pages. <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> This lets search engines crawl the page and all links on it, but they will not index the page and so any content on it won't get counted as duplicate content. The code goes within the <head> ...


1

Edited Jul, 07 2014 at 6:28 There are a lot of gotchas with your approach. It will not work if there are any custom rewrite rule, it (probably) will not work if server is IIS and pretty permalink are active, it will not work for custom post types, it will not work for archive or search urls and so on. To obtain a sing post/page url from a url in a ...


0

There's a simple solution using a Good and an Odd Mechanism. The Good Part function api_query_url() { // Check that the URL is set and is in fact a string if ( ! isset( $_POST['url'] ) || gettype( $_POST['url'] ) !== 'string' ) { api_response( false, 400, "'url' is a required parameter!" ); } // Add an extra parameter to the url. $api_url = ...


1

When you include index.php/ at the start of your custom permalink structure you are telling WordPress to use PATHINFO permalinks. WordPress Codex - PATHINFO: "Almost_Pretty" It is possible you are using an IIS (Windows) server or that mod_rewrite is not working correctly. Permalinks without mod_rewrite The following plugin can help you determine if ...


-3

Add flush_rewrite_rules(); After your register_taxonomy() function


0

Just faced the same situation and stumbled upon this question while googling. It seems like this isn't possible. Core itself just appends strings to the URL if pretty permalinks are enabled, see https://core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/link-template.php#L571 For anyone interested in this: You can do something like this in your ...


0

Parsing of the requested URL happens in the file wp-includes/class-wp.php. The magic happens starting at line 148 in the parse_request function. For path info style permalinks, $_SERVER['PATH_INFO'] is used, for pretty permalinks, $_SERVER['REQUEST_URI'] is used.


0

I will expand my question with more information for better understanding. At the /testting/ folder (the blog's directory). The basic .htaccess shows: RewriteBase /testting/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /testting/index.php [L] Once ...


0

If i understand right what you're looking for is get_query_var( $var ) which return the given var passed trough the rewrite process. http://codex.wordpress.org/Function_Reference/get_query_var Here a list of WordPress Query Vars http://codex.wordpress.org/WordPress_Query_Vars For debugging purpose you can get a list of all the query_vars using: global ...


0

With a lot of help from @Eric Holmes, I think we've found a solution. The basic idea is to add my own rewrite rules to create the permalink structure I'm after. I added this to my functions.php: function add_rewrite_rules(){ global $wp; $wp->add_query_var( 'fakepage' ); $parentpage = 'ADD THE TOP LEVEL PAGE'S POST ID HERE'; ...


0

You'll need to add the year, month, and day portions to the post's permalink in your post_link callback: $link = str_replace( '/' . $pto->rewrite[ 'slug' ] . '/', '/' . get_the_time( 'Y/m/d', $post ) . '/', $link ); This will return a permalink such as example.com/2014/07/02/post-name. You'll have to adjust the logic in your pre_get_posts ...


0

When you register a new post type for the first time, you need to visit Settings -> Permalinks so WordPress can set up the permalink rules for it. You don't even need to hit save, visiting the page is enough.



Top 50 recent answers are included