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 | |
/* | |
* Plugin Name: AmanHstu Video Widget | |
* Author: Amanur Rahman | |
* Author URI: http://www.ahsanurrahman.com | |
* Plugin URI: http://www.ahsanurrahman.com | |
* Description: This will show a video widget in widget section | |
* Version: 1.0 | |
*/ |
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 | |
$post_object = get_field('field'); | |
if($post_object) : | |
$post = $post_object; | |
// Overwrite $post | |
setup_postdata( $post ); ?> | |
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> | |
<?php | |
// Reset $post so the rest of the page works | |
wp_reset_postdata(); |
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 echo substr(apply_filters( ‘woocommerce_short_description’, $post->post_excerpt ),0,230).’ …’; ?> |
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 while ( have_posts() ) : the_post(); ?> | |
<div class="main-content"> | |
<div class="main-wrap"> | |
<div class="col-sm-12"> | |
<div class="breadcrumbs"> | |
<?php if(function_exists('bcn_display')) { bcn_display(); }?> | |
</div> <!-- breadcrambs ends here --> | |
</div><!-- col-sm-12 ends here --> | |
<?php // check for rows (parent repeater) | |
if( have_rows('product_page') ): ?> |
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 // Advanced custom fields repeater | |
if(get_field('repeater_field_name')): ?> | |
<ul> | |
<?php while(has_sub_field('repeater_field_name')): ?> | |
<li>sub_field_1 = <?php the_sub_field('sub_field_1'); ?>, sub_field_2 = <?php the_sub_field('sub_field_2'); ?>, etc</li> | |
<?php endwhile; ?> | |
</ul> |
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// check if the repeater field has rows of data | |
if( have_rows('repeater_field_name') ): // loop through the rows of data | |
while ( have_rows('repeater_field_name') ) : the_row(); // display a sub field value | |
the_sub_field('sub_field_name'); | |
endwhile; | |
else : // no rows foundendif; | |
?> |
OlderNewer