Tag Info

New answers tagged

2

Re: the comments above: Read http://codex.wordpress.org/Changing_The_Site_URL It says: There are four easy methods to change the Site URL manually. Any of these methods will work and perform much the same function. And the Codex outlines each one. The first one is the easiest; add these lines to wp-config.php with FTP or your hosting control panel ...


0

You can rewrite you .htaccess if you are familiar with this. Add the below line and try it: RewriteRule ^category/(.+)$ http://www.site.com/$1 [R=301,L]


0

If you go to Settings->Permalinks you should be able to set the tag/category base URL rules which should solve this problem. Or, use some sort of plugin to do what you want. This one came up first on Google: http://wordpress.org/plugins/custom-permalinks/


0

Probably because /icons is a default path in the Apache server. AFAIK it can’t be changed/overriden in .htaccess, because it is defined as Alias in the Apache configuration. See, for example, this question on Stack Overflow: how to override index of /icons?


0

Wordpress has some pretty solid documentation for this. What you are asking for will require that you learn a good bit of programming. Check out here for basic plugin development information: https://codex.wordpress.org/Writing_a_Plugin This page has specific information about making your own administration panels: ...


1

There can be a lot of issues when moving a WordPress multisite. as a general rule, I usually start with a fresh vanilla WordPress site, go through the Multisite installation to ensure my wp-config.php and .htaccess files are setup correctly. Then, I import my database, and go through all the tables needed - changing URLs and domains where necessary. I made ...


0

admin-bar.min.css is not registered via the normal wp_register_style channels. It, and the other default styles, are registered by wp_default_styles, which registers them by directly manipulation the $styles object, though I don't know what good that is since there are no hooks and you shouldn't be hacking core files. You should still be able to deregister ...


1

Make sure there is an index.php in the directory, and make that file the index file. Example for .htaccess: DirectoryIndex index.php


0

I agree with XIROXAS, but if for some reason you really do want to do it the way you described, it's probably already done for you anyway. Yoast SEO should already be adding a <link rel="canonical"> in your header, based on your site url setting, which I would imagine uses the tld you consider to be the main one. This is assuming you don't have ...


1

Canonical links are really more useful for when you have multiple URLs on the same domain pointed at the same content to help tell search engines to only index the specified URL. What you are going to want to do is redirect that domain site.net to site.com. Trust me; things are easier that way, and it's way better for SEO purposes. You can do that either ...


0

The query string format-- the "default" permalink-- should always work. For posts that is ?p=<post-id> for pages it is ?page=<page-id>, though ?p= will also work for pages (with the overhead or a redirect). Categories are ?cat=<cat-id>. Tags are ?tag=<tag-id>. There are many others.


1

get parameter for this is paged. Example: mydomain.tld?paged=2


1

Running something similar to your code I get this warning in the error log: Warning: Cannot modify header information - headers already sent by (output started at /xxx/wordpress/wp-content/themes/balance/functions.php:4) in /xxx/wordpress/wp-includes/pluggable.php on line 876 When I used this to test: $redirecturl = 'google.com'; wp_redirect( 'http://' . ...


1

First, you register your query vars param1 and param2: function wpse_101951_query_vars( $qv ) { $qv[] = 'param1'; $qv[] = 'param2'; return $qv; } add_filter( 'query_vars', 'wpse_101951_query_vars' ); To use this information, you can pretty much hook into any action or filter after parse_query. That's the first action available after the query ...


2

First, it is hard to believe that wp_redirect isn't working, below some (example) code how to use it: function wpse101952_redirect() { global $post; if( /*SOME CONDITIONAL LOGIC*/ ) { //examples: is_home() or is_single() or is_user_logged_in() or isset($_SESSION['some_var']) wp_redirect( /*SOME SPECIFIC URL*/ ); exit(); } } ...


0

Read about WordPress is_ssl() not working behind reverse proxies and install the SSL Insecure Content Fixer plugin so that you can easily test whether you can add a fix based on $_SERVER['HTTP_X_FORWARDED_PROTO']; see that plugin's FAQ. If you have the misfortune to be hosted by Network Solutions, you can fix your problem by installing this simple plugin ...


0

I'm using a plugin for this called WordPress HTTPS. If you still intend to code a solution yourself, maybe you can get some ideas from it at least.


0

Just discovered that as of version 6.2 of Theme My Login the %username% variable is available for use in the Custom Links module. Therefore to add a link to the user's BuddyPress messages from the widget, the URL is http://yoursite.com/members/%username%/messages.


1

I think this will do what you are looking for. add_action("template_redirect", 'template_redirect'); function template_redirect() { global $wp; if(is_user_logged_in() && !isset($_GET['user'])){ $current_user= get_userdata(get_current_user_id()); ...


0

I'd be curious if someone can find a better solution to this. Here's what I came up with: function wpse_91821_flatten_page_paths( $wp ) { if ( false !== strpos( $wp->matched_query, 'pagename=' ) && isset( $wp->query_vars['pagename'] ) && $wp->query_vars['pagename'] && false === strpos( $wp->query_vars['pagename'], '/' ...



Top 50 recent answers are included