The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| <?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 ); |
| <?php | |
| // Set featured images size | |
| add_image_size( 'designsbynore-admin-post-featured-image', 125, 125, false ); | |
| // Add the column | |
| function designsbynore_post_list_thumbnail_column($designsbynore_columns){ | |
| $designsbynore_columns['designsbynore_thumb'] = __('Featured Image', 'textdomain' ); | |
| return $designsbynore_columns; | |
| } |
| <?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')){ |
| <?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] ) . ');}'; | |
| /* | |
| * 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 { |
| <?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 } |
| <?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 |
| 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); |