Changing the visible url path to css & js files

Offhand I think you’d need two things: First, a rewrite rule in your .htaccess file like so: RewriteEngine On RewriteBase / RewriteRule ^css/(.*) /wp-content/themes/theme-name/css/$1 [L] RewriteRule ^js/(.*) /wp-content/themes/theme-name/js/$1 [L] Second, add a filter to your theme’s functions.php like so: function change_css_js_url($content) { $current_path=”/wp-content/themes/theme-name/”; $new_path=”https://wordpress.stackexchange.com/”; // No need to add /css or /js here since you’re … Read more

switch theme on fly

You can use Theme Switch and Preview. If you are up for coding this yourself, you can use the template and stylesheet filters. E.g.: to switch to Twenty Ten: function custom_load_twenty_ten_template() { return ‘twentyten’; } function custom_load_twenty_ten_stylesheet() { return ‘twentyten’; } add_filter( ‘template’, ‘custom_load_twenty_ten_template’ ); add_filter( ‘stylesheet’, ‘custom_load_twenty_ten_stylesheet’ );

Using WordPress as piecemeal in existing site?

Can I include content from Pages in WordPress and output that content on any page outside of the WP install directory? Is there something specific I would need to include? You can load WP engine in any PHP file, see integrating WP with your website in Codex. Do I have to use a Theme or … Read more

Jquery in Child Theme

First off, jquery is most likely already enqueued by the main theme. But if not, the proper way is to call wp_enqueue_script(‘jquery’) in a function for the action hook wp_enqueue_scripts. Example: function enqueue_jquery() { wp_enqueue_script(‘jquery’); } add_action(‘wp_enqueue_scripts’, ‘enqueue_jquery’). This code would need to be added to the functions.php file for your child theme. You would … Read more

Separate WordPress themes for each category page

I think what would work best for your case is making use of the WordPress template hierarchy. You can actually just create a custom template file in your theme folder named category-{slug}.php to get a custom look for that category. Example: If your category was ‘Dogs’ and the slug you set for it was ‘dog’, … Read more

Moving WordPress.com theme and widget settings to self-hosted site?

First off, check if the theme is available in wordpress.org themes: http://wordpress.org/extend/themes/ If it’s not, find the name of the theme developer and contact them. Many developers of wordpress.com themes are happy for people to use their themes on self-hosted WordPress blogs. The developer’s name and contact details can be found by looking at style.css. … Read more

How can I add a set featured image function to a theme that doesn’t already have it built in?

You can add this line to your functions.php file to add the post thumbnail option to all post types: add_theme_support( ‘post-thumbnails’ ); If you want it for only one post type, you pass an array of post type names as second argument: add_theme_support( ‘post-thumbnails’, array( ‘post’ ) ); #shown in posts only To display the … Read more