Skip to content

Instantly share code, notes, and snippets.

View iqbalrony's full-sized avatar
🏠
Working from home

Iqbal Hossain Rony iqbalrony

🏠
Working from home
View GitHub Profile
@iqbalrony
iqbalrony / custom-function-for-wp.php
Last active July 19, 2023 10:27
Necessary function, which can be used in making of theme for client or ThemeForest or helper plugin for page builder. (custom function for wp)
<?php
/**
* Necessary function, which can be used in making of theme
* for client or ThemeForest or helper plugin for page builder.
*/
/**
* Those two functions are for set and get attribute for html tag.
* Example:- for set attribute
@iqbalrony
iqbalrony / Extend-exiting-Elementor-widget.php
Last active September 28, 2023 13:47
Add a custom control and render attribute to an existing Elementor widget
<?php
// This example will add a custom "select" drop down & "switcher" to the "testimonial" section
// and add custom "color" to the "testimonial style" section
add_action('elementor/element/before_section_end', 'add_control_in_existing_widget', 10, 3 );
function add_control_in_existing_widget( $section, $section_id, $args ) {
if( $section->get_name() == 'testimonial' && $section_id == 'section_testimonial' ){
// we are at the end of the "section_testimonial" area of the "testimonial"
$section->add_control(
'testimonial_name_title_pos' ,
[
@iqbalrony
iqbalrony / on-hover-post-query-by-ajax.js
Created May 15, 2019 05:09
On hover post query by ajax
(function ($) {
"use strict";
function dgm_reset_position($current, $item){
if( $current.length === 0 )
return;
var $item = $current.next('.dgm_product_item');
var tipX = $current.outerWidth();
@iqbalrony
iqbalrony / wp-custom-reset-password-form.php
Last active March 6, 2024 16:09
WordPress custom reset password form
<?php
/*
*Example Follw:-https://code.tutsplus.com/tutorials/build-a-custom-wordpress-user-flow-part-3-password-reset--cms-23811
*/
// Create the custom pages at plugin activation
register_activation_hook( __FILE__, 'dgm_plugin_activated' );
function dgm_plugin_activated() {
// Information needed for creating the plugin's pages
$page_definitions = array(
@iqbalrony
iqbalrony / Setup SMTP Mail server on xampp (localhost))
Last active May 28, 2019 03:24
You can setup SMTP mail server on xampp local server.
----------------------------------------------------------------------------------
This is only for windows operator.
You have to edit two file on xampp folder to setup SMTP mail on local server
and some setup on your gmail account.There are 3 steps which are:-
1. php.ini file from this folder location ==> C:\xampp\php\php.ini
2. sendmail.ini file from this flder location ==> C:\xampp\sendmail\sendmail.ini
3. Go to this link https://support.google.com/accounts/answer/6010255
----------------------------------------------------------------------------------
/**
* 1st step....
<?php
if ( !class_exists( 'DGM_Reset_PassWord' ) ) {
/**
*
* Forgot password form
* Reset password form
*
*/
class DGM_Reset_PassWord {
@iqbalrony
iqbalrony / search-form-for-special-post-type.php
Last active May 30, 2019 04:34
Search form for special post type.
<!-- search for special one post type -->
<div class="search-form">
<form role="search" method="get" class="search-form mc-form bottom" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" class="search-field" placeholder="<?php esc_html_e( 'Enter your keyword', 'text-domain' ) ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" />
<input type="hidden" name="post_type" value="product">
<button type="submit" class="search-submit"><span class="ti ti-search"></span></button>
</form>
</div>
<!-- search for special two or more post type -->
@iqbalrony
iqbalrony / on-click-search-box-open-close.php
Last active June 1, 2019 08:34
The search form will show, on click of search icon and hide, on click of anywhere in the body except search input.
<div class="search-form">
<form role="search" method="get" class="search-form mc-form bottom" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" id="" class="search-field" placeholder="<?php esc_html_e( 'Enter your keyword', 'digimart' ) ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" />
<button type="submit" class="search-submit"><span class="ti ti-search"></span></button>
</form>
</div>
<script>
$(document).ready(function () {
/**
* To externally insert jQuery on that webpage from your browser’s console
* all you need to do is to copy-paste and run the following code in the console.
*/
var script = document.createElement("script");
script.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
@iqbalrony
iqbalrony / get_icon_cls_from_console_by_jquery.js
Last active February 11, 2021 07:06
Get all icon class name or data attribute from console panel by jQuery and JavaScript. ( get class name, get attribute )
//Run all following codes in a browser console panel
var cls_array = []; //array declaration (or var cls_array = new Array())
console.log(typeof cls_array); //type var type check
var icon_tags = $('.icons i'); //variable declaration for icon tag. you set your class name whatever you need
console.log(icon_tags.length);
icon_tags.each(function () {
var $self = $(this),