This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git remote set-url origin git@bitbucket.org:-----add new url form git/bitbucket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $imageContent = get_the_content(); | |
| $stripped = strip_tags($imageContent, '<p> <a>'); //replace <p> and <a> with whatever tags you want to keep after the strip | |
| echo $stripped; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * add mobile version of logo | |
| */ | |
| function mobile_logo_customize_register( $wp_customize ) { | |
| $wp_customize->add_setting( 'logo_mobile' ); // Add setting for logo uploader | |
| // Add control for logo uploader (actual uploader) | |
| $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo_mobile', array( | |
| 'label' => __( 'Logo (mobile version)', 'm1' ), | |
| 'section' => 'title_tagline', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * remove custom logo classes | |
| */ | |
| function helpwp_custom_logo_output( $html ) { | |
| $html = str_replace('custom-logo-link', 'navbar-item is-hidden-touch', $html ); | |
| $html = str_replace('custom-logo', 'logo-main', $html ); | |
| return $html; | |
| } | |
| add_filter('get_custom_logo', 'helpwp_custom_logo_output', 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ADDING CUSTOM POST TYPE | |
| add_action('init', 'all_custom_post_types'); | |
| function all_custom_post_types() { | |
| $types = array( | |
| // News and Events | |
| array('the_type' => 'premier-league', | |
| 'single' => 'Fantasty Premier league', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php while( have_posts() ) : the_post(); ?> | |
| <?php if( ! empty( $post->post_title ) ) : ?> | |
| <h1><?php the_title(); ?></h1> | |
| <?php endif; ?> | |
| <?php endwhile; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( '' !== get_post()->post_content ) { | |
| // do something | |
| } | |
| // credit goes to https://wordpress.stackexchange.com/questions/121359/if-the-post-has-content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $thecontent = get_the_content(); | |
| if(!empty($thecontent)) { ?> | |
| // do or output something | |
| <?php } ?> // break php tag for HTML block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ADDING CUSTOM POST TYPE | |
| add_action('init', 'all_custom_post_types'); | |
| function all_custom_post_types() { | |
| $types = array( | |
| // News and Events | |
| array('the_type' => 'premier-league', | |
| 'single' => 'Fantasty Premier league', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| $(".pause-videos").click(function(){ | |
| var stopAllYouTubeVideos = () => { | |
| var iframes = document.querySelectorAll('.booking-forms iframe'); | |
| Array.prototype.forEach.call(iframes, iframe => { | |
| iframe.contentWindow.postMessage(JSON.stringify({ event: 'command', | |
| func: 'pauseVideo' }), '*'); | |
| }); | |
| } | |
| stopAllYouTubeVideos(); |