Skip to content

Instantly share code, notes, and snippets.

View webdevs-pro's full-sized avatar

WebDevs.pro webdevs-pro

View GitHub Profile
@webdevs-pro
webdevs-pro / Debug.php
Created July 28, 2019 20:57 — forked from sunel/Debug.php
PHP Pretty var_dump
View Debug.php
<?php
class Debug {
/**
* A collapse icon, using in the dump_var function to allow collapsing
* an array or object
*
* @var string
*/
View base.php
<?php
public function enqueue_script(){
wp_register_script( 'general-script', EC_EXTENTIONS_URL . 'assets/js/script.js', [ 'jquery' ], EC_ELEMENTOR_VERSION, true );
}
public function register_frontend_styles(){
wp_register_style('general-style', EC_EXTENTIONS_URL . 'assets/css/general.css', array(), EC_ELEMENTOR_VERSION);
}
public function enqueue_frontend_styles(){
@webdevs-pro
webdevs-pro / index.php
Created September 17, 2019 04:10
set woo product fatured image by product first gallery image
View index.php
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => -1
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
@webdevs-pro
webdevs-pro / script.js
Created December 1, 2019 23:32
Facebook share modal
View script.js
jQuery(document).ready(function($) {
$('.fb_share a').click(function(e) {
e.preventDefault();
window.open($(this).attr('href'), 'fbShareWindow', 'height=450, width=600, top=' + ($(window).height() / 2 - 275) + ', left=' + ($(window).width() / 2 - 300) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
return false;
});
});
@webdevs-pro
webdevs-pro / gist:df6911c5dcb3160ec28a8732bfefb9b4
Created December 30, 2019 18:15 — forked from oooh-boi/gist:3e3fbb773ebbd647b92de8880aa4c5ef
CSS and jQuery code used in "Custom Slider in Elementor built with Elementor" video tutorial
View gist:df6911c5dcb3160ec28a8732bfefb9b4
/* ---------- CSS
- should be "attached" to the master Section */
/* make 100% wide columns possible for Desktop devices in Elementor */
.custom-swiper .elementor-container .elementor-row {
/*flex-wrap: wrap;*/
}
/* make all the colums-slides 100% wide and full screen tall */
.custom-swiper > .elementor-container > .elementor-row > .elementor-element.elementor-column {
width: 100%;
@webdevs-pro
webdevs-pro / index.php
Last active January 6, 2020 08:47
view&update custom fields in the [ultimatemember_account] page
View index.php
<?php
add_action('um_after_account_general', 'showUMExtraFields', 100);
function showUMExtraFields() {
$id = um_user('ID');
$output = '';
$names = array('birth_date');
$fields = array();
foreach( $names as $name ) {
@webdevs-pro
webdevs-pro / index.php
Created January 7, 2020 08:48
Ultimate Member custom fields for account tab + custom tabs
View index.php
<?php
// add custom registration fields to UM account tab
add_action('um_after_account_general', 'AAshowUMExtraFields', 100);
function AAshowUMExtraFields() {
$id = um_user('ID');
$output = '';
$names = array('birth_date', 'height', 'football_club', 'phone_number');
$fields = array();
foreach( $names as $name ) {
@webdevs-pro
webdevs-pro / index.php
Created January 10, 2020 13:52
php convert text with <br> to JSON format text
View index.php
<?php
$daily_reading_in_word = get_field('daily_reading_in_word');
$daily_reading_in_word = trim( preg_replace( '/(\r\n)|\n|\r/', '<br/>', $daily_reading_in_word ) );
$daily_reading_in_word = str_replace('<br/>','\r\n',$daily_reading_in_word);
$daily_reading_in_word = str_replace('<br />','',$daily_reading_in_word);
@webdevs-pro
webdevs-pro / style.css
Created January 20, 2020 22:05
Messenger custom dark styles
View style.css
body, html {
background: black;
}
/* FIX */
._5irm._7mkm {
background-color: transparent !important;
@webdevs-pro
webdevs-pro / style.css
Created January 24, 2020 01:33
offsetting an html anchor to adjust for fixed header
View style.css
:target:before {
content: '';
display: block;
height: 100px;
margin-top: -100px;
visibility: hidden;
}