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
// Show post type Singular Label on singular post page: | |
$post = get_queried_object(); | |
$postType = get_post_type_object(get_post_type($post)); | |
if ($postType) { | |
echo esc_html($postType->labels->singular_name); | |
} | |
// Show post type Singular Label in the loop: | |
$postType = get_post_type_object(get_post_type()); | |
if ($postType) { |
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 $the_query = new WP_Query( array( 'post_type' => 'slider', 'order' => 'ASC' ) ); ?> | |
<?php if ( $the_query->have_posts() ) : ?> | |
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> | |
<img src="<?php the_field('slide_image'); ?>" alt="<?php the_field('slide_title'); ?>" /> | |
<?php the_field('slide_title'); ?> | |
<?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
<?php echo esc_url( get_permalink( $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
<?php echo do_shortcode('['.get_field('custom_field_name').']'); ?> |
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 $the_query = new WP_Query( array( 'post_type' => 'post', 'order' => 'ASC' ) ); ?> | |
<?php if ( $the_query->have_posts() ) : ?> | |
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> | |
<?php get_template_part( 'template-parts/page/content', 'front-page' ); ?> | |
<?php endwhile; ?> | |
<?php wp_reset_postdata(); ?> | |
<?php endif; ?> |
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
// More info: https://speckyboy.com/getting-started-with-wordpress-shortcodes-examples/ | |
function sample_template($title, $type, $order) { | |
$the_query = new WP_Query( array( 'post_type' => $type, 'order' => $order, ) ); | |
if ( $the_query->have_posts() ) : ?> | |
<h2><?php echo $title; ?></h2> | |
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> | |
<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
/** | |
* Theme Options | |
*/ | |
add_action('customize_register', function($wp_customize) { | |
/** | |
* Add Custom Logo | |
*/ | |
$wp_customize->add_setting('logo_img'); |
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
// prevent to display outline on mouse click | |
$("a").on("mousedown", function(){ | |
$(this).css('outline', 'none'); | |
}); |
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
$('html, body').animate({ | |
scrollTop: ($('.sroll-to-element').first().offset().top) | |
},500); | |
// Scroll to Main content | |
$( '.scroll-to-content' ).click(function() { | |
$('html, body').animate({ | |
scrollTop: ($('.homepage-main').first().offset().top) | |
},800); | |
}); |
OlderNewer