Skip to content

Instantly share code, notes, and snippets.

View amanhstu's full-sized avatar

Amanur Rahman amanhstu

View GitHub Profile
<?php if( have_rows('repeater_field_name') ): ?>
<ul class="slides">
<?php while( have_rows('repeater_field_name') ): the_row();
// vars
$image = get_sub_field('image');
$content = get_sub_field('content');
$link = get_sub_field('link'); ?>
<li class="slide"> <?php if( $link ): ?>
<?php $post_object = get_field('post_object');
if( $post_object ):     // override $post    
$post = $post_object;    
setup_postdata( $post );     ?>   
<div>        
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>        
<span>Post Object Custom Field: <?php the_field('field_name'); ?></span>   
</div>   
<?php while ( have_posts() ) : the_post(); ?>
<div class="main-content">
<div class="main-wrap">
<?php // check for rows (parent repeater)
if( have_rows('product_page') ): ?>
<div class="col-lg-12 row product-row">
<?php // loop through rows (parent repeater)
while( have_rows('product_page') ): the_row(); ?>
define( 'OT_THEME_MODE', apply_filters( 'ot_theme_mode', true ) );
add_filter( 'ot_theme_mode', '__return_true' );
add_filter( 'ot_show_pages', '__return_true' );
require_once ('option-tree/ot-loader.php');
add_filter( 'ot_show_pages', '__return_true' );
add_filter( 'woocommerce_product_tabs', 'woo_rename_tab', 98);function woo_rename_tab($tabs) {$tabs['description']['title'] = 'Full Description';return $tabs;}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); function woo_remove_product_tabs( $tabs ) { unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
}
@amanhstu
amanhstu / Creating_and_showing_value_of_Metabox.php
Last active February 6, 2019 21:21
Creating a meta box in wordpress post and showing that value in your theme file
<?php
// Sub Title Metabox
/**
* function to return a custom field value.
*/
function wpshed_get_custom_field( $value ) {
global $post;
<?php // Custom Pagination for loop
function custom_pagination($numpages = '', $pagerange = '', $paged='') {
if (empty($pagerange)) {
$pagerange = 2;
}
/**
* This first part of our function is a fallback