Skip to content

Instantly share code, notes, and snippets.

View norewp's full-sized avatar

Zulfikar Nore norewp

View GitHub Profile
@norewp
norewp / Contract Killer 3.md
Created August 30, 2017 01:01 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@norewp
norewp / after-setup-theme.php
Created September 13, 2017 07:36
Enqueue child theme style immediately after parent
<?php
function themename_scripts() {
global $themename_version; // This should be defined early on
$parent_style = 'parent-style'; // This is 'parent-style' for your theme.
$child_style = 'child-style';
//wp_enqueue_style( 'actions-style', get_template_directory_uri() . '/style.css', '', $themename_version );
if ( wp_get_theme()->get('Name') != 'ThemeName' ) {
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css', array(), $themename_version );
@norewp
norewp / elementorcssinhead.php
Created October 16, 2017 19:47 — forked from nicomollet/elementorcssinhead.php
Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
<?php
/**
* Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
*/
function elementor_css_in_head(){
if(class_exists('\Elementor\Plugin')){
$elementor = \Elementor\Plugin::instance();
$elementor->frontend->enqueue_styles();
}
if(class_exists('\ElementorPro\Plugin')){
@norewp
norewp / elementor-canvas-scripts.php
Last active July 21, 2022 21:06
Custom scripts only on the Elementor Canvas template
<?php // You probably don't need to add this opening PHP tag!
function my_custom_canvas_scripts() {
$classes = get_body_class();
if ( in_array( 'page-template-elementor_canvas', $classes ) ) { ?>
<script type="text/javascript">
<!--[Custom Script]><!-->
//(function($) { //Uncomment this for no conflict jQuery
// Add your script here
<?php
function nore_home_logo() {
$centered_logo = '';
$handle = 'nore-style';
$custom_logo_id = get_theme_mod( 'custom_logo' );
$logo_render = wp_get_attachment_image_src( $custom_logo_id , 'full' );
$centered_logo .= 'header .main-navigation ul > li.my-site-logo a {background-image: url(' . esc_url( $logo_render[0] ) . ');}';
@norewp
norewp / vid-bg-mob.css
Last active December 9, 2017 21:39
Render background video on mobile view
/*
* In the section which you have the video background add something like el-show-video-mobile to the CSS ID field
*
* Then apply this CSS rule in the Custom CSS box and you should have the background video showing on mobile
*
* NOTE: The class elementor-hidden-phone is hardcoded in Elementor Section's rendered output & this hack only overrides the CSS rule set on it.
*/
@media (max-width: 767px) {
body:not(.elementor-editor-active) #el-show-video-mobile > .elementor-background-video-container.elementor-hidden-phone {
@norewp
norewp / elementor-accordion-closed.php
Last active April 17, 2018 10:59
Keep Accordions closed on page load
<?php
function elementor_accordion_closed() { ?>
<script>
jQuery(document).ready(function() {
jQuery( '.elementor-accordion .elementor-tab-title' ).removeClass( 'elementor-active' );
jQuery( '.elementor-accordion .elementor-tab-content' ).css( 'display', 'none' );
});
</script>
<?php }
@norewp
norewp / opineo-review.php
Last active January 2, 2018 16:38
Add Opineo code as a shortcode for use with WordPress
<?php
function opineo_review_func( $atts ) {
return readfile("https://www.opineo.pl/shop/latest.php?s=52913&w=500&n=4&secured=1");
}
add_shortcode( 'opineo', 'opineo_review_func' );
// Usage [opineo] in any shortcode supporting widget or content area
@norewp
norewp / functions.php
Created January 10, 2018 23:45 — forked from lukecav/functions.php
Disable Elementor overview dashboard widget in WordPress
function disable_elementor_dashboard_overview_widget() {
remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'disable_elementor_dashboard_overview_widget', 40);