Skip to content

Instantly share code, notes, and snippets.

@wpsoul
Forked from gelebrin/functions.php
Last active August 2, 2020 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsoul/af000d662a564aabb15a4867a326a027 to your computer and use it in GitHub Desktop.
Save wpsoul/af000d662a564aabb15a4867a326a027 to your computer and use it in GitHub Desktop.
Add Articles to Store page(WCFM) - REHUB
add_action( 'wcfmmp_before_store_article', function( $store_id, $store_info ) {
?>
<div class="main-side clearfix<?php if (rehub_option('archive_layout') == 'gridfull' || rehub_option('archive_layout') == 'dealgridfull' || rehub_option('archive_layout') == 'compactgridfull' || rehub_option('archive_layout') == 'columngridfull' || rehub_option('archive_layout') == 'cardblogfull') : ?> full_width<?php endif ;?>">
<?php if (rehub_option('archive_layout') == 'blog') : ?>
<div class="">
<?php elseif (rehub_option('archive_layout') == 'newslist') : ?>
<div class="">
<?php elseif (rehub_option('archive_layout') == 'communitylist') : ?>
<div class="">
<?php elseif (rehub_option('archive_layout') == 'deallist') : ?>
<div class="woo_offer_list " >
<?php elseif (rehub_option('archive_layout') == 'grid') : ?>
<?php wp_enqueue_script('masonry'); wp_enqueue_script('imagesloaded'); wp_enqueue_script('masonry_init'); ?>
<div class="masonry_grid_fullwidth col_wrap_two">
<?php elseif (rehub_option('archive_layout') == 'gridfull') : ?>
<?php wp_enqueue_script('masonry'); wp_enqueue_script('imagesloaded'); wp_enqueue_script('masonry_init'); ?>
<div class="masonry_grid_fullwidth col_wrap_three">
<?php elseif (rehub_option('archive_layout') == 'columngrid') : ?>
<div class="columned_grid_module rh-flex-eq-height col_wrap_three" >
<?php elseif (rehub_option('archive_layout') == 'columngridfull') : ?>
<div class="columned_grid_module rh-flex-eq-height col_wrap_fourth">
<?php elseif (rehub_option('archive_layout') == 'compactgrid') : ?>
<div class="eq_grid post_eq_grid rh-flex-eq-height <?php echo (rehub_option('width_layout') =='extended') ? 'col_wrap_fifth' : 'col_wrap_fourth';?>">
<?php elseif (rehub_option('archive_layout') == 'compactgridfull') : ?>
<div class="eq_grid post_eq_grid rh-flex-eq-height <?php echo (rehub_option('width_layout') =='extended') ? 'col_wrap_six' : 'col_wrap_fifth';?>">
<?php elseif (rehub_option('archive_layout') == 'cardblog') : ?>
<div class="coloredgrid rh-flex-eq-height <?php echo (rehub_option('width_layout') =='extended') ? 'col_wrap_fourth' : 'col_wrap_three';?>">
<?php elseif (rehub_option('archive_layout') == 'cardblogfull') : ?>
<div class="coloredgrid rh-flex-eq-height <?php echo (rehub_option('width_layout') =='extended') ? 'col_wrap_fifth' : 'col_wrap_fourth';?>">
<?php elseif (rehub_option('archive_layout') == 'dealgrid') : ?>
<div class="eq_grid post_eq_grid rh-flex-eq-height <?php echo (rehub_option('width_layout') =='extended') ? 'col_wrap_fourth' : 'col_wrap_three';?>">
<?php elseif (rehub_option('archive_layout') == 'dealgridfull') : ?>
<div class="eq_grid post_eq_grid rh-flex-eq-height <?php echo (rehub_option('width_layout') =='extended') ? 'col_wrap_fifth' : 'col_wrap_fourth';?>">
<?php else : ?>
<div class="">
<?php endif ;?>
<?php
}, 50, 2);
add_action( 'wcfmmp_store_article_template', function() {
?>
<?php if (rehub_option('archive_layout') == 'blog') : ?>
<?php include(rh_locate_template('inc/parts/query_type2.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'newslist') : ?>
<?php $type='2'; ?>
<?php include(rh_locate_template('inc/parts/query_type1.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'communitylist') : ?>
<?php include(rh_locate_template('inc/parts/query_type1.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'deallist') : ?>
<?php include(rh_locate_template('inc/parts/postlistpart.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'grid' || rehub_option('archive_layout') == 'gridfull') : ?>
<?php include(rh_locate_template('inc/parts/query_type3.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'columngrid' || rehub_option('archive_layout') == 'columngridfull') : ?>
<?php include(rh_locate_template('inc/parts/column_grid.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'cardblog' || rehub_option('archive_layout') == 'cardblogfull') : ?>
<?php include(rh_locate_template('inc/parts/color_grid.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'compactgrid' || rehub_option('archive_layout') == 'compactgridfull') : ?>
<?php $gridtype = 'compact'; include(rh_locate_template('inc/parts/compact_grid.php')); ?>
<?php elseif (rehub_option('archive_layout') == 'dealgrid' || rehub_option('archive_layout') == 'dealgridfull') : ?>
<?php include(rh_locate_template('inc/parts/compact_grid.php')); ?>
<?php else : ?>
<?php include(rh_locate_template('inc/parts/query_type1.php')); ?>
<?php endif ;?>
<?php
});
add_action( 'wcfmmp_store_article_template_none', function() {
?>
<h5><?php _e('Sorry. No articles yet!', 'rehub_framework'); ?></h5>
<?php
});
add_action( 'wcfmmp_after_store_article', function( $store_id, $store_info ) {
?>
</div></div>
<div class="clearfix">
<?php
rehub_pagination();
echo '</div>';
}, 50, 2);
add_filter( 'wcfm_is_allow_store_articles', '__return_true' );
add_filter('wcfm_marketplace_settings_fields_visibility', 'wcfm_marketplace_settings_fields_visibility2104', 50, 2 );
function wcfm_marketplace_settings_fields_visibility2104($general_fields,$vendor_id) {
unset($general_fields['store_hide_map']);
return $general_fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment