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
| <!-- header --> | |
| <?php | |
| $rows = count( get_field('slider') ); | |
| if ( is_front_page() && ( $rows > 1 ) && !$phone ) { | |
| $themefolder = get_bloginfo('template_directory'); | |
| echo '<link rel="stylesheet" type="text/css" href="' . $themefolder . '/css/unslider.css">' . PHP_EOL; | |
| } | |
| ?> | |
| <!-- slider --> |
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 | |
| // If your title is within the header or another include | |
| if ( is_home() ) { | |
| $postspage = get_option('page_for_posts'); | |
| $postspagetitle = get_the_title( $postspage ); | |
| echo '<h1>' . $postspagetitle . '</h1>'; | |
| } | |
| ?> | |
| <?php |
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 | |
| $referer = wp_get_referer(); // Get the full URL of the referring URL | |
| $refer_postid = url_to_postid( $referer ); // Convert the URL into a post ID | |
| if ( $refer_postid ) { | |
| // If the conversion was successful we have an ID, let us get more details | |
| $refer_title = get_the_title( $refer_postid ); // Get the post title | |
| echo '<p>Thank you for your interest in the role; <a href="' . $referer . '">' . $refer_title . '</a>.</p>'; | |
| } | |
| ?> |
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 | |
| $excerpt = get_the_excerpt(); | |
| $char_limit = 110; | |
| $excerpt_stripped = strip_tags( $excerpt ); // Remove any tags using the strip_tags function. | |
| $excerpt_length = strlen( $excerpt_stripped ); // Now lets count the characters so we can compare | |
| if ( $excerpt_length > $char_limit ) { // Now work out if we need to trim the character length. | |
| $offset = $char_limit - $excerpt_length; // This gives us a negative value. | |
| $position = strrpos( $excerpt_stripped, ' ', $offset ); // This starts looking for a space backwards from the offset | |
| $trimmed_excerpt = substr( $excerpt_stripped, 0, $position ); // Trim up until the point of the last space. | |
| $last_character = substr( $trimmed_excerpt, -1 ); // Identify the last character of the newly trimmed excerpt |
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
| @mixin transition($transition-property, $transition-time, $method) { | |
| // These two cover pretty much everything from 2008. Apart from IE 6-9. But fuck that prick of a browser. | |
| -webkit-transition: $transition-property $transition-time $method; // Need this for Chrome pre-dating 2013 and Safari 3 - 6 | |
| transition: $transition-property $transition-time $method; | |
| } | |
| // Example use: @include transition(all, 0.5s, ease); | |
| @mixin vertical-align($position) { | |
| position: $position; | |
| top: 50%; |
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 | |
| $args = array( | |
| 'posts_per_page' => 5, | |
| 'post_type' => 'post' | |
| ); | |
| $posts = get_posts( $args ); | |
| if ( $posts ) { | |
| $counter = 1; | |
| echo '<ul>'; | |
| foreach ( $posts as $post ) : setup_postdata( $post ); |
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
| <style> | |
| div.goal-meter .progression { | |
| transform: rotate(-90deg); | |
| } | |
| div.goal-meter .progression .meter { | |
| stroke-linecap: round; | |
| fill: none; | |
| } | |
| div.goal-meter .progression #face { | |
| stroke: #EEE; |
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
| <div class="form-group"> | |
| <label for="your-name">Full name</label> | |
| [text your-name id:your-name class:form-control placeholder "Your full name"] | |
| </div> | |
| <div class="form-group"> | |
| <label for="your-email">Email address</label> | |
| [email* your-email id:your-email class:form-control placeholder "Enter email"] | |
| </div> | |
| <div class="form-group"> | |
| <label for="your-phone">Phone number</label> |
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 | |
| if( have_rows('testimonials') ): | |
| echo '<div id="testimonials" class="carousel slide" data-ride="carousel" data-pause="false">'; | |
| echo '<div class="carousel-inner">'; | |
| $count = 1; | |
| while( have_rows('testimonials') ): the_row(); | |
| $testimonial = get_sub_field('testimonial_text'); | |
| $author = get_sub_field('testimonial_author'); | |
| echo '<div class="carousel-item text-center py-5'; | |
| if ( $count == 1 ) { |
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 | |
| $current_id = get_the_ID(); | |
| $parent_id = wp_get_post_parent_id( $current_id ); | |
| $template = get_page_template_slug( $parent_id ); | |
| $template_filename = 'template-page.php'; // Change this to the template name | |
| ?> | |
| <?php | |
| if ( $template == $template_filename ) { | |
| echo 'Yes, the parent post uses ' . $template_filename; |