Change from blogger to wordpress

You can use the same custom domain for WordPress blog. Steps to follow (if you want to go with self hosted WordPress): First purchased a hosting for WordPress from any hosting company. Install WordPress on temporary URL provided in hosting account. Import all the posts and comments from blogger.com blog by using default imported tool … Read more

How to make a rest style plugin?

I got a little piece of code here, but it should/could probably be improved. Create new query_vars Create new rewrite rule Redirect to specific template which then handles your parameters Create new query vars function register_gallery_query_vars($vars) { $vars[] = ‘gallery_id’; $vars[] = ‘image_id’; return $vars; } add_filter(‘query_vars’, ‘register_gallery_query_vars’); Add rewrite rule function custom_rewrite_gallery() { add_rewrite_rule(‘^gallery/([0-9]+)/([0-9]+)/?’, … Read more

How to use plugins_url() inside PHP stylesheet file [duplicate]

Try background:url(<?php echo plugins_url().’/myimgfolder/my_img.png’; ?>) no-repeat <?php echo $x_position.’ ‘.$y_position; ?>; It will allow you to echo the PHP elements into your style. EDIT: You also need to close the file, you’re trying to mix unwrapped PHP with your CSS. Your PHP variables aren’t escaped either. I’ve tested the code below, and it works fine: … Read more

add custom entries to menu options

Here a very quick example. The idea is to add a new meta box in the menu configuration. add_meta_box is used in admin_head-nav-menus.php page: class Custom_Nav { function __construct() { add_action( ‘admin_head-nav-menus.php’, array( $this, ‘add_nav_menu_meta_boxes’ ) ); } public function add_nav_menu_meta_boxes() { add_meta_box( ‘custom_links’, __(‘Custom links’), array( $this, ‘nav_menu_link’), ‘nav-menus’, ‘side’, ‘low’ ); } public … Read more

WooCommerce or any other plugin: Deliver JS and CSS through CDN without using a Plugin

WC()->plugin_url() is basically a wrapper for the core function plugins_url(). That functions return value is filtered. return apply_filters( ‘plugins_url’, $url, $path, $plugin ); So you should be able to add a filter to that hook that returns the initial value if $plugin isn’t woocommerce, then checks if the path or URL leads to one of … Read more