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 / image-upload-widget.php
Created June 24, 2019 11:12
Footer logo widget with little description.
<?php
/**
* Register widget.
*/
if (!function_exists('pws_about_widget_reg')) {
function pws_about_widget_reg() {
register_widget('pws_about_widget');
}
add_action('widgets_init', 'pws_about_widget_reg');
@iqbalrony
iqbalrony / custom-icon-add-to-elementor.php
Last active April 4, 2023 12:31
Adding custom icon to icon control in Elementor.
<?php
/**
* Adding custom icon to icon control in Elementor
*/
function modify_icon_controls($controls_registry) {
//3696 material design icon classes
$material_design_icons_cls = 'mdi mdi-access-point, mdi mdi-access-point-network, mdi mdi-access-point-network-off, mdi mdi-account, mdi mdi-account-alert, mdi mdi-account-alert-outline, mdi mdi-account-arrow-left, mdi mdi-account-arrow-left-outline, mdi mdi-account-arrow-right, mdi mdi-account-arrow-right-outline, mdi mdi-account-badge, mdi mdi-account-badge-alert, mdi mdi-account-badge-alert-outline, mdi mdi-account-badge-horizontal, mdi mdi-account-badge-horizontal-outline, mdi mdi-account-badge-outline, mdi mdi-account-box, mdi mdi-account-box-multiple, mdi mdi-account-box-outline, mdi mdi-account-card-details, mdi mdi-account-card-details-outline, mdi mdi-account-check, mdi mdi-account-check-outline, mdi mdi-account-child, mdi mdi-account-child-circle, mdi mdi-account-circle, mdi mdi-account-circle-outline, mdi mdi-account-clock, mdi mdi-account-clock-
@iqbalrony
iqbalrony / owlCarousel2-init.js
Last active July 21, 2019 08:17
Owl-Carousel2-init
(function ($) {
"use strict";
$.fn.product_slider = function () {
return this.each(function () {
var $self = $(this);
var $settings = $self.data('settings');
$self.owlCarousel2({
items: 4,
loop: true,
@iqbalrony
iqbalrony / custom-pagination.php
Last active July 24, 2019 10:06
Custom pagination for custom post type.
$page_1 = isset($_GET['page_1'])? $_GET['page_1'] : 1;
$query_args = [
'post_type' => 'post',
'posts_per_page' => $settings['posts_per_page'],
'orderby' => $settings['orderby'],
'order' => $settings['order'],
'ignore_sticky_posts' => 1,
'post_status' => 'publish',
//'paged' => get_query_var('paged') ? absint(get_query_var('paged')) : 1,
'paged' => $page_1,
@iqbalrony
iqbalrony / class.php
Created July 28, 2019 05:38 — forked from igorbenic/class.php
Extending Elementor: Custom Button Field & Skin | https://www.ibenic.com/extending-elementor-custom-button-field-skin
<?php
add_action( 'elementor/widget/before_render_content', 'custom_render_button' );
/**
* Adding a new attribute to our button
*
* @param \Elementor\Widget_Base $button
*/
function custom_render_button( $button ) {
@iqbalrony
iqbalrony / functions.php
Last active May 30, 2023 10:09
How to add/use/register elementor dynamic tag with elementor free version. This is a very easy and useful system of Elementor. Especially I feel the need for this when I use URL control. Help link -> (https://developers.elementor.com/dynamic-tags/)
<?php
/**
* Post URL list
*/
if (!function_exists('prefix_get_all_posts_url')) {
function prefix_get_all_posts_url($posttype = 'post') {
$args = array(
'post_type' => $posttype,
'post_status' => 'publish',
@iqbalrony
iqbalrony / custom-css.php
Last active November 22, 2023 11:56
How to add custom css control with elementor free version.
<?php
use Elementor\Controls_Manager;
use Elementor\Element_Base;
use Elementor\Core\Files\CSS\Post;
use Elementor\Core\DynamicTags\Dynamic_CSS;
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
@iqbalrony
iqbalrony / custom-control-init.php
Last active December 29, 2022 09:36
Create Elementor Custom Control. Image selector control
<?php
namespace ElementorControls;
if (!defined('ABSPATH')) exit; // Exit if accessed directly
class Elementor_Custom_Controls {
public function includes() {
require_once(plugin_dir_path(__FILE__).'inc/elementor/image-selector-control.php');
}
@iqbalrony
iqbalrony / rss_feed.php
Last active December 1, 2019 14:22
The way to get data from rss feed url.
$post_per_page = 8;
$url = 'https://www.feedforall.com/sample.xml';
// $url = 'https://www.feedforall.com/sample-feed.xml';
// $url = 'https://www.feedforall.com/blog-feed.xml';
// $url = 'http://www.rss-specifications.com/blog-feed.xml';
$url = ! empty( $url ) ? $url : '';
while ( stristr( $url, 'http' ) != $url ) {
$url = substr( $url, 1 );