Tag Info

Hot answers tagged

4

You can use wp-config.php to change the site url depending on where the site is accesed from, using $_SERVER['REMOTE_ADDR']. Mine has something like this: if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' || $_SERVER['REMOTE_ADDR'] == '::1') { // accesing site from my local server define('WP_SITEURL', 'http://localhost/mysite/'); define('WP_HOME', ...


1

And the strange part: both codes echo the same string for $url!!! No, they don't. Look at the page source. esc_url() is encoding the & control character. You can't do that and expect the HTTP request to work correctly. Use esc_url_raw() instead. Note the description in the Codex concerning that function: The esc_url_raw() function is similar to ...


1

After checking phpinfo(), mod_rewrite wasn't enabled so I enabled it: http://linuxcommando.blogspot.fr/2014/03/how-to-enable-modrewrite-for-apache-web.html and it worked !


1

In WordPress, the footer scripts are enqueued using wp_enqueue_scripts into wp_footer(). So it is hard for you to find the direct scripts link in footer.php. To change the path you can go to PHPmyAdmin and edit the siteurl and home fields in options table of your database. You can include jQuery from CDN using the following code: // Register Script ...


1

Good news for WordPress versions 4.2+ Since version 4.2 the handy get_avatar_url() function, introduced as a feature request in ticket #21195 few years ago, now ships with the core: /** * Retrieve the avatar URL. * * @since 4.2.0 * * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, * ...


1

It depends on your image and stylesheet location. But this is the syntax: .theme-image { background-image: url('../images/header-img.jpg'); } The above code is for the structure wp-content - themes - your-theme - images - header-img.jpg - css - style.css You are making the browser come one directory before and search for images ...


1

You can not do that viw .htaccess because .htacces rules can not control how the permalinks are generated by WordPress. Instead, go to WordPress settings->permalink. Select custom structure and enter: blog/%category%/%postname%


1

Change Settings -> Permalinks to Post Name. Go to your page and edit the Permalink field below the title field.


1

Change the Settings -> Permalink to Custom Structure /%category%/%postname%/ Now while editing the post, check only the subcategory and now the parent category is nested within the URL automatically.



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