Get the current post parent category ID
How to get the current post parent category ID? Just copy the codes below and paste this your template.
global $post; $category = get_the_category( get_the_ID() ); $parent = $category[0]->term_id
How to access/download mp4 files of vimeo videos? Using this URL https://player.vimeo.com/video/169074515/config, where 169074515 is the video ID, using https://player.vimeo.com/video/169074515/config will show all video information. See the sample codes below. Here’s the sample MP4 video URL your can download or use in your custom video player. //View this URL in new tab. Where 169074515 is…
Facebook share says “Not Found Back to Facebook” using Elated Themes error can be fix by using this codes below. Just edit this code in social-share.php file located in your theme folder/framework/modules/shortcodes/socialshare/social-share.php case 'facebook': if ( wp_is_mobile() ) { $link = 'window.open(\'http://m.facebook.com/sharer.php?u=' . urlencode(get_permalink()). '\', \'sharer\', \'toolbar=0,status=0,width=620,height=280\');'; } else { $link = 'window.open(\'http://www.facebook.com/sharer.php?s=100&p[title]=' . urlencode(kreate_elated_addslashes(get_the_title()))…
How to disable zoom in/zoom out on google map iframe tag? Just use style=”pointer-events:none” inline CSS. see example below. <iframe style="pointer-events:none" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1804.199470732143!2d55.32552972069876!3d25.25716190966307!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0000000000000000%3A0x5fea75ca1d9225ff!2sEmirates+Islamic+Bank!5e0!3m2!1sen!2sph!4v1463111255665" width="100%" height="450" frameborder="0" style="border:0" allowfullscreen></iframe> Output:
All of the codes below will be place on your function.php Change number of products displayed per page add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 1000;' ), 20 ); Archive columns global $woocommerce_loop; $woocommerce_loop['columns'] = 4; // Change the product category list column to 4. Archive columns with body class add_filter('body_class','archive_columns'); function archive_columns($classes) { global $woocommerce_loop; $classes[]…
Here’s how The7 WordPress themes page layout change via filter functions. How to manage your page/post layout? Remove sidebar or sidebar in left or right? We can use filter function to do the task. This is mostly used in custom post type pages. Original code snippets of The7 WordPress themes inc/helpers/html-helpers.php function presscore_main_container_classes( $custom_class =…
How to make video iframe responive? Copy the CSS below and make sure that there is a ” iframe-wrap ” before the iframe element. CSS .iframe-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .iframe-wrap iframe, .iframe-wrap object, .iframe-wrap embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%;…