Month: December 2016

wordpress

How to redirect wp-admin url to some other url

 https://wordpress.org/plugins/protect-wp-admin/

wordpress

WordPress core functions

<?php wp_head(); ?> : To load scripts and link from plugins <?php get_post_custom($post_id); ?> :  to get values from custom fields , as parameters pass id of post, otherwise current post details will return.

woocommerce

WordPress plugin to list woocommerce taxonomies with images.

First of all set image uploading plugin to categories. We have used plugin: “Category images”: https://wordpress.org/plugins/categories-images/ Then we can choose the categories from the widget and show anywhere in the website with sidebars. Plugin : book-features  

woocommerce

Best Selling product widget code in woocommerce

Add these code to your functions.php to include a new widget for best selling products: function registering_widget() { register_widget( ‘WC_Widget_best_selling_products’); } add_action( ‘widgets_init’, ‘registering_widget’ ); // best selling products class WC_Widget_best_selling_products extends WC_Widget { /*** Constructor.***/ public function __construct() { $this->widget_cssclass    = ‘Best Selling Products’; $this->widget_description = __( ‘Best Selling Products in store’, ‘woocommerce’ );…

wordpress

Category link from category id

$cat_link=get_category_link($cat_id);

Php

Allowed memory size of bytes exhausted (tried to allocate bytes) in php

Just add this below line to before line of you getting error in your php or config file ini_set(‘memory_limit’, ‘-1’);   Here are two simple methods to increase the limit on shared hosting: If you have access to your PHP.ini file, change the line in PHP.ini If your line shows 32M try 64M: memory_limit =…

HTML Jquery & Javascript

Auto-sliding not working after clicking the controls in bxslider

Add “onSlideAfter” parameter in bxslider options: var slider = $(‘.bxslider’).bxSlider({ auto: true, pager: false, autoHover: true, autoControls: true, onSlideAfter: function() { slider.stopAuto(); slider.startAuto(); } });

wordpress

Query pots based on taxonomies id

Displaying posts based on post type taxonomies: <?php $args = array( ‘post_type’ => ‘imageslider’,   // Post type ‘showposts’ =>4,     // Number of sliders ‘tax_query’ => array( array( ‘taxonomy’ => ‘imagecategories’,   // Taxonomy name ‘field’ => ‘id’, ‘terms’ => $postTaxonomy, ) ) ); query_posts($args); ?>  

wordpress

Listing all taxonomies in wordpress

<?php $taxonomies = get_taxonomies(); foreach ( $taxonomies as $taxonomy ) { echo $taxonomy; } ?> Reference : https://codex.wordpress.org/Function_Reference/get_taxonomies

wordpress

New widget adding in wordpress

Add below code in functions.php: // widget adding function lbi_widgets_init() { register_widget( ‘My_Widget_Avatar’ ); } add_action( ‘widgets_init’, ‘lbi_widgets_init’ ); class My_Widget_Avatar extends WP_Widget { /** * Register widget with WordPress. */ function __construct() { parent::__construct( ‘wmu_text_widget’, // Base ID __(‘text test Widget’, ‘text_domain’), // Name array(‘description’ => __(‘testing Widget’, ‘text_domain’),) // Args ); } public…

Load More