Tag Info

Hot answers tagged

8

get_bloginfo('url') calls home_url() calls get_home_url() reads option home get_bloginfo('wpurl') calls site_url() calls get_site_url() reads option siteurl get_bloginfo('siteurl') and get_bloginfo('home') are deprecated arguments and return get_bloginfo('url') (siteurl argument is documented wrong in Codex as equal to wpurl, it's not in current code) The ...


5

There's a pretty good step by step on moving WordPress in the Codex. It is what I follow when changing domains. Moving the files is pretty straight-forward. It is the hard-coded references in the database that are tricky. However, serialized search and replace will take care of all database changes. I've used the Velvet Blues plugin in the past, but ...


5

You could filter the option requests for the host. In your wp-config.php below the line … require_once ABSPATH . 'wp-settings.php'; … add the following lines: add_filter( 'pre_option_home', 'set_current_host' ); add_filter( 'pre_option_siteurl', 'set_current_host' ); function set_current_host() { return 'http://' . $_SERVER['HTTP_HOST']; } ...


5

If you want WP installed in a directory but the site home on your domain root, you need to move the main index.php file out to your domain root and edit the require statement to point within your directory. This process is outlined here: Giving WordPress Its Own Directory.


4

I believe there are some root-links that you haven't changed. Please follow these steps Login to admin section www.xyz.com/wp-admin Navigate to settings->general-> and change the 'Site Address (URL)' and 'WordPress Address (URL)'. Also please check the permalinks and settings->media there is an upload directory and the default wordpress location is ...


4

You are asking two questions at once: What's the difference between home_url() and site_url()? How do I get WordPress to return the URL root without the subdirectory where it's installed? Here are the answers, and I confirmed with Andrew Nacin, a core developer of WordPress, as well as ran some server tests to confirm what Andrew told me. Question # 1 ...


4

I utilize the awesome plugin Duplicator to complete this exact procedure on a regular basis. http://wordpress.org/extend/plugins/duplicator/ The plugin is fully supported and there are great FAQ available here: http://lifeinthegrid.com/labs/duplicator/ The plugin will create a .zip backup of both your database and files and an installer .php that you ...


3

You will have a few things to consider (later on the answer), I suggest the following steps: Backup your Files and Database This is pretty self-explanatory. You are going to do a lot of Data Manipulation, so be sure your original is safe. Transfer your files The fastest way to do this is to have a hoster where you can import directories from another ...


3

The difference in your case is in filters being applied to output of these functions. While bloginfo applies one of these filters: if ( 'display' == $filter ) { if ( $url ) $output = apply_filters('bloginfo_url', $output, $show); else $output = apply_filters('bloginfo', $output, $show); } Function home_url ...


3

This question has been discussed several times on the WordPress Hackers email list, I'd recommend Googling something like wp-hackers absolute relative to get an overview of the various lively debates that have taken place over the years. Personally I use the searchreplacedb2 script whenever I migrate a database between URLs, e.g. from live to ...


2

This question has been asked many many times before. Here's the Codex: http://codex.wordpress.org/Changing_The_Site_URL The easiest thing to do is add a couple of lines to your wp-config.php define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');


2

Change your blog IDs in the wp-config.php file define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 ); That means Site ID 1 is the main site. IF you change that, another site will be the main site. You have to change your blog URLs around so it knows sub.mysite is now mysite. You'll probably have to do that in teh DB directly.


2

Open your backend and go to Settings/General. You will see to input fields: WordPress Address (URL) Site Address (URL) The first one correspond to site_url() and the second one to home_url() So why is there a difference? Because WordPress is able to start from a different site then your blog posts. For example, create a page called 'homepage' and enter ...


1

Copy the index.php and .htaccess file(Just copy it , do not move it ) from myblog directory to root directory. Open index.php file in any text editor and find the following code in the file. /** Loads the WordPress Environment and Template */ require('./wp-blog-header.php'); Replace it with the following code and save the file. /** Loads the WordPress ...


1

See the Moving WordPress page in the Codex. When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://newexample.com - there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can ...


1

There is no need to use any plugins, scripts or even knwledge of sql. Simple notepad is enough to migration. You have to upload your all wordpress files to your new server and just change in your wp-config.php (in your main wordpress folder) 3 values: define('DB_NAME', 'your_new_db_name'); define('DB_USER', 'your_db_username'); define('DB_PASSWORD', ...


1

Caching is not your problem here. The home URL and site URL are stored in the wp_options table in your database. You can update them either by visiting the Settings > General page in your WordPress dashboard, or you can edit the siteurl and home option values directly in the database through an SQL query or a client such as phpMyAdmin. You can also override ...


1

Not sure I exactly understand your problem, but it sounds like what you want to do could easily be accomplished using Custom post types: http://codex.wordpress.org/Post_Types#Custom_Types This would basically allow you to have an entire segment just for 'learn' completely separated from your general posts/blog - you could even give 'learn' it's own styling ...


1

I agree with @robin and tend to use that search & replace tool (interconnectit) for more complex DB's. For simple installs though, I like to use Peach, since it's a slightly less involved process. I'll often start off trying Peach, and then move to interconnectit's tool if there are any issues with the transfer (I've had some issues with Peach handling ...


1

To answer you second question: Q: If that's correct, then can I get wordpress to return http://example.com/ ? Not unless you use the giving WordPress it own directory. Using this means you put WordPress core files into /blog or /WordPress and then the index.php into your root If you decide to put WordPress inside its own directory then you would use ...


1

From 'wp-includes/general-template.php' function get_bloginfo( $show = '', $filter = 'raw' ) { switch( $show ) { case 'home' : // DEPRECATED case 'siteurl' : // DEPRECATED _deprecated_argument([snipped]); case 'url' : $output = home_url(); break; case 'wpurl' : $output = site_url(); break; ...


1

Suggestion: I suppose that you have a backend interface that use custom fields to do this. Don't use permalinks in this fields, instead save the post_id of the page that you want to link in the custom field and use get_permalink() in your code Example: Custom field name: link_to_page In your code, use, for example echo ...


1

Open your site http://"ip address" go to http://"ip address"/wp-admin/options-general.php in the General Settings change the Site Address (URL) from http://"My IP Address" to http://"My IP Address"/wordpress Its done


1

This is straightforward if I understand the question properly. Use the "WordPress MU Domain Mapping" plugin: http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/ Update I think something like the following should work in your .htaccess: RewriteCond %{HTTP_HOST} www.exampleurl.com RewriteCond %{REQUEST_URI} !^/testsite RewriteRule ^(.*)$ ...


1

You can override the database setting in wp-config.php define( 'WP_HOME', 'http://example.org' ); //<------This is what you want users to type into their browser to reach your site. define( 'WP_SITEURL', 'http://example.org/wordpress' ); //<-------- This is where Wordpress is installed.


1

Edit: Wow. I mistyped a bunch the first time around. Hopefully nobody read that. All corrected now. /edit I went code spelunking... :) Short version, the workaround would be this: <?php $front_page_id = get_option( 'page_on_front' ); $my_permalink = _get_page_link( $front_page_id ); ?> If you look into link-template.php in the WordPress ...


1

Better Answer: session_start(); $lead = $_GET['lead']; $_SESSION['lead'] = $lead; Then, create an additional field on the form, with the input hidden. For the value, I would echo out the $_SESSION, with a name that is easy to grab (lead works). then, wherever the form is processed, just add a line to grab the lead, and do with it what you want. –


1

The variable in my copy of wordpress on the line your error indicates is actually $current_site as opposed to $current_blog (I may have a newer version of WP). I believe you can clear that by changing the value of the option_name "siteurl" or "blogname" in your wp_options table on your database.



Only top voted, non community-wiki answers of a minimum length are eligible