Skip to content

Instantly share code, notes, and snippets.

@INDIAN2020
Last active August 29, 2015 14:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save INDIAN2020/0a0fa6fe0ce5b4819217 to your computer and use it in GitHub Desktop.
Save INDIAN2020/0a0fa6fe0ce5b4819217 to your computer and use it in GitHub Desktop.
<?php
/**
* WooCommerce Job Packages
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Jobify
* @since Jobify 1.0
*/
global $wp_query;
$count = 1;
$packages = new WP_Query( array(
'post_type' => 'product',
'limit' => -1,
'tax_query' => array(
array(
'taxonomy' => 'product_type',
'field' => 'slug',
'terms' => 'job_package'
)
)
) );
get_header(); ?>
<header class="page-header">
<h1 class="page-title"><?php _e( 'Job Packages', 'jobify' ); ?></h1>
</header>
<div id="primary" class="content-area">
<div id="content" class="container" role="main">
<div class="job-packages pricing-table-widget row" style="width: 100%">
<?php while ( $packages->have_posts() ) : $packages->the_post(); $package = get_product( get_post()->ID ); ?>
<div class="pricing-table-widget woocommerce col-lg-4 col-md-6 col-sm-12">
<div class="pricing-table-widget-title">
<?php the_title(); ?>
</div>
<div class="pricing-table-widget-description">
<h2><?php echo $package->get_price_html(); ?></h2>
<p><span class="rcp_level_duration">
<?php
printf( _n( '%d job', '%s jobs', $package->get_limit(), 'jobify' ) . ' ', $package->get_limit() );
printf( _n( 'for %s day', 'for %s days', $package->get_duration(), 'jobify' ), $package->get_duration() );
?>
</span></p>
<?php the_content(); ?>
<p>
<?php
$link = $package->add_to_cart_url();
$label = apply_filters( 'add_to_cart_text', __( 'Add to cart', 'jobify' ) );
?>
<a href="<?php echo esc_url( $link ); ?>" class="button-secondary"><?php echo $label; ?></a>
</p>
</div>
</div>
<?php if ( $count % 3 == 0 ) : ?></div><div class="job-packages pricing-table-widget row" style="width: 100%"><?php endif; ?>
<?php $count++; endwhile; ?>
</div>
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment