This file contains 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 the_post_thumbnail( 'large', ['alt' => get_the_title()] ); ; ?> |
This file contains 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
/* functions.php */ | |
// Create pagination | |
function foundation_pagination( $query = '' ) { | |
if ( empty( $query ) ) { | |
global $wp_query; | |
$query = $wp_query; | |
} | |
// required for static front-page pagination | |
if ( get_query_var('paged') ) { |
This file contains 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
// Modify The Read More Link Text | |
function modify_read_more_link() { | |
if(get_field('readmore_text', 'options')) { | |
return '<a class="button" href="' . get_permalink() . '">' . get_field( 'readmore_text', 'options' ) . '</a>'; | |
} else { | |
return '<a class="button" href="' . get_permalink() . '"> ' . __( 'Readmore', 'theme_name' ) .' </a>'; | |
} | |
} | |
// for content more link |
This file contains 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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains 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
// For Post Type | |
<?php $the_query = new WP_Query( array( 'post_type' => 'contacts', 'order' => 'ASC', ) ); | |
if ( $the_query->have_posts() ) : ?> | |
<ul class="footer-contacts"> | |
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> | |
<?php if( have_rows('contact_types') ): ?> | |
<?php while( have_rows('contact_types') ): the_row(); ?> | |
<li> | |
<?php if (get_sub_field('contact_type')): ?> | |
<span class="contact-title"><?php the_sub_field('contact_type'); ?></span> |
This file contains 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
// Hide outline for all links | |
$('a').on('mousedown', function(){ | |
$(this).css('outline', 'none'); | |
}); | |
// Scroll to Main content | |
$( '.scroll-to-content' ).click(function() { | |
$('html, body').animate({ | |
scrollTop: ($('main').first().offset().top) | |
},800); |
This file contains 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
<meta name="format-detection" content="telephone=no"> |
This file contains 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
// clean phone number for link "tel:1234567" | |
preg_replace("#(?<=\d)[\s-]+(?=\d)#","", $number) | |
// phone number | |
preg_match('/^\+[0-9\-\s]*(\([0-9]+\))?[0-9\-\s]*$/', $number) | |
preg_match("/[0-9a-z]+@[a-z.]/", $email) | |
// phone number with WP ACF |