keithg

Site redirect non www to www within folder

Add in .htaccess   Without folder : [crayon-58d314b8b86f8038235674/]   With Folder : <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{REQUEST_URI} ^/folder/ RewriteRule ^(.*)$ https://www.xyz.com/folder/$1 [R=301,L] </IfModule>Read more …
keithg

Create Post type without plugin – WordPress

Add this code in function.php add_action( ‘init’, ‘create_post_type’ ); function create_post_type() { register_post_type( ‘acme_product’, array( ‘labels’ => array( ‘name’ => __( ‘Products’ ), ‘singular_name’ => __( ‘Product’ ) ), ‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘trackbacks’, ‘custom-fields’, ‘comments’, ‘revisions’, ‘page-attributes’ ), ‘public’ => true, ‘has_archive’ => true, ) );...Read more …
keithg

Wp-content moved to specific Folder – wordpress

Create folder name on root (like.your site name: XYZ) Add code in wp-config.php   wp-content define( ‘WP_CONTENT_DIR’, dirname(__FILE__) . ‘/XYZ/wp-content’ ); define( ‘WP_CONTENT_URL’, ‘http://xyz.com/XYZ/wp-content’ );   Plugins define( ‘WP_PLUGIN_DIR’, dirname(__FILE__) . ‘/XYZ/wp-content/plugins’ ); define( ‘WP_PLUGIN_URL’, ‘/XYZ/wp-content/plugins’ ); Your site will open from  XYZ/wp-content/  Read more …