function page_sidebar_add_meta_boxes() { global $post; $template_file = get_post_meta($post->ID, '_wp_page_template', true); if ($template_file != 'page-contact.php' && $template_file != 'page-contact-form-7.php' && !SocialChef_Theme_Utils::is_a_woocommerce_page()) { add_meta_box($this->page_sidebars_meta_box->id, $this->page_sidebars_meta_box->title, array($this->page_sidebars_meta_box, 'meta_box_callback'), 'page', 'normal', 'high'); } }
function widget($args, $instance) { extract($args); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : ''); /* Before widget (defined by themes). */ $before_widget = str_replace('class="widget', 'class="widget share', $before_widget); echo $before_widget; /* Display Widget */ /* Display the widget title if one was input (before and after defined by themes). */ global $post; $main_image = ''; if ($post != null) { $sc_post = new sc_post($post); $main_image = $sc_post->get_main_image(); } ?> <ul class="boxed"> <li class="light"><a target="_blank" href="https://twitter.com/intent/tweet?text=<?php echo urlencode(SocialChef_Theme_Utils::get_current_page_url()); ?> " title="<?php _e('Twitter', 'socialchef'); ?> "><i class="ico i-twitter"></i> <span><?php _e('Share on Twitter', 'socialchef'); ?> </span></a></li> <li class="medium"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?display=popup&u=<?php echo urlencode(SocialChef_Theme_Utils::get_current_page_url()); ?> " title="<?php _e('Facebook', 'socialchef'); ?> "><i class="ico i-facebook"></i> <span><?php _e('Share on Facebook', 'socialchef'); ?> </span></a></li> <li class="dark"><a target="_blank" href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(SocialChef_Theme_Utils::get_current_page_url()); ?> &media=<?php echo esc_url($main_image); ?> &description=" title="<?php _e('Pinterest', 'socialchef'); ?> "><i class="ico i-pinterest"></i> <span><?php _e('Pin on Pinterest', 'socialchef'); ?> </span></a></li> <!--<li class="dark"><a href="#" title="Favourites"><i class="ico i-favourites"></i> <span>Add to Favourites</span></a></li>--> </ul> <?php /* After widget (defined by themes). */ echo $after_widget; }
/** * Defines an array of options that will be used to generate the settings page and be saved in the database. * When creating the 'id' fields, make sure to use all lowercase and no spaces. * * If you are making your theme translatable, you should replace 'socialchef' * with the actual text domain for your theme. Read more: * http://codex.wordpress.org/Function_Reference/load_theme_textdomain */ function optionsframework_options() { $color_scheme_array = array('theme-default' => __('Default', 'socialchef'), 'theme-black' => __('Black', 'socialchef'), 'theme-blue' => __('Blue', 'socialchef'), 'theme-brown' => __('Brown', 'socialchef'), 'theme-green' => __('Green', 'socialchef'), 'theme-grey' => __('Grey', 'socialchef'), 'theme-orange' => __('Orange', 'socialchef'), 'theme-pink' => __('Pink', 'socialchef'), 'theme-purple' => __('Purple', 'socialchef'), 'theme-red' => __('Red', 'socialchef'), 'theme-teal' => __('Teal', 'socialchef'), 'theme-yellow' => __('Yellow', 'socialchef')); $pages = get_pages(); $pages_array = array(); $pages_array[0] = __('Select page', 'socialchef'); foreach ($pages as $page) { $pages_array[$page->ID] = $page->post_title; } $options = array(); $options[] = array('name' => __('General Settings', 'socialchef'), 'type' => 'heading'); $options[] = array('name' => __('Website logo', 'socialchef'), 'desc' => __('Upload your website logo to go in place of default theme logo.', 'socialchef'), 'id' => 'website_logo_upload', 'type' => 'upload'); $options[] = array('name' => __('Select color scheme', 'socialchef'), 'desc' => __('Select website color scheme.', 'socialchef'), 'id' => 'color_scheme_select', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $color_scheme_array); $options[] = array('name' => __('Enable RTL', 'socialchef'), 'desc' => __('Enable right-to-left support', 'socialchef'), 'id' => 'enable_rtl', 'std' => '0', 'type' => 'checkbox'); $options[] = array('name' => __('Footer copyright notice', 'socialchef'), 'desc' => __('Copyright notice in footer.', 'socialchef'), 'id' => 'copyright_footer', 'std' => '© socialchef.com 2013. All rights reserved.', 'type' => 'text'); $options[] = array('name' => __('Footer call to action', 'socialchef'), 'desc' => __('Footer call to action text. If left blank, call to action will not be shown.', 'socialchef'), 'id' => 'footer_call_to_action', 'std' => __('Already convinced? Join us by registering right now.', 'socialchef'), 'type' => 'text'); $options[] = array('name' => __('Footer call to action button', 'socialchef'), 'desc' => __('Footer call to action button text. If call to action (above) text is left blank, call to action button will not be shown.', 'socialchef'), 'id' => 'footer_call_to_action_button', 'std' => __('Join Us', 'socialchef'), 'type' => 'text'); $options[] = array('name' => __('Footer call to action link', 'socialchef'), 'desc' => __('Footer call to action link url.', 'socialchef'), 'id' => 'footer_call_to_action_url_id', 'std' => '/', 'type' => 'text'); $options[] = array('name' => __('WP Settings', 'socialchef'), 'type' => 'heading'); $options[] = array('name' => __('Override wp-login.php', 'socialchef'), 'desc' => __('Override wp-login.php and use custom login, register, forgot password pages', 'socialchef'), 'id' => 'override_wp_login', 'std' => '0', 'type' => 'checkbox'); if (!defined('BP_VERSION')) { $options[] = array('name' => __('Users specify password', 'socialchef'), 'desc' => __('Let users specify their password when registering', 'socialchef'), 'id' => 'let_users_set_pass', 'std' => '0', 'type' => 'checkbox'); } $options[] = array('name' => __('Page Settings', 'socialchef'), 'type' => 'heading'); $options[] = array('name' => __('Search recipes page url', 'socialchef'), 'desc' => __('Page that displays custom recipe search form and results.', 'socialchef'), 'id' => 'search_form_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Redirect to after login', 'socialchef'), 'desc' => __('Page to redirect to after login if "Override wp-login.php" is checked above', 'socialchef'), 'id' => 'redirect_to_after_login_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Redirect to after logout', 'socialchef'), 'desc' => __('Page to redirect to after logout if "Override wp-login.php" is checked above', 'socialchef'), 'id' => 'redirect_to_after_logout_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Login page url', 'socialchef'), 'desc' => __('Login page url if "Override wp-login.php" is checked above', 'socialchef'), 'id' => 'login_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Register page url', 'socialchef'), 'desc' => __('Register page url if "Override wp-login.php" is checked above', 'socialchef'), 'id' => 'register_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Reset password page url', 'socialchef'), 'desc' => __('Reset password page url if "Override wp-login.php" is checked above', 'socialchef'), 'id' => 'reset_password_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Contact us page url', 'socialchef'), 'desc' => __('Contact us page url', 'socialchef'), 'id' => 'contact_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Show "socialchef in numbers" section on home page?', 'socialchef'), 'desc' => __('If checked the "socialchef in numbers" section will be shown on home page?', 'socialchef'), 'id' => 'show_social_chef_in_numbers_on_homepage', 'std' => '1', 'type' => 'checkbox'); $options[] = array('name' => __('Featured recipes page url', 'socialchef'), 'desc' => __('Featured recipes page url used in featured recipe widget', 'socialchef'), 'id' => 'featured_recipes_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Featured members page url', 'socialchef'), 'desc' => __('Featured members page url used in featured member widget', 'socialchef'), 'id' => 'featured_members_page_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Submit recipes page url', 'socialchef'), 'desc' => __('Submit recipes page url', 'socialchef'), 'id' => 'submit_recipes_url_id', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $pages_array); $options[] = array('name' => __('Home Page', 'socialchef'), 'type' => 'heading'); $options[] = array('name' => __('Intro image', 'socialchef'), 'desc' => __('If you want to change the intro image background shown on top of the home page, upload your replacement here.', 'socialchef'), 'id' => 'home_intro_background', 'type' => 'upload'); $options[] = array('name' => __('Frontend submissions', 'socialchef'), 'type' => 'heading'); $options[] = array('name' => __('Publish frontend submitted content immediately?', 'socialchef'), 'desc' => __('When users submit content via frontend, do you wish to publish it immediately or do you leave it for admin to review first?', 'socialchef'), 'id' => 'publish_frontend_submissions_immediately', 'std' => '0', 'type' => 'checkbox'); $options[] = array('name' => __('Recipes', 'socialchef'), 'type' => 'heading'); $options[] = array('name' => __('Single recipe permalink slug', 'socialchef'), 'desc' => __('The permalink slug used for single recipes (by default it is set to "recipe". <br /><strong>Note:</strong> Please make sure you flush your rewrite rules after changing this setting. You can do so by navigating to <a href="/wp-admin/options-permalink.php">Settings->Permalinks</a> and clicking "Save Changes".', 'socialchef'), 'id' => 'recipes_permalink_slug', 'std' => 'recipe', 'type' => 'text'); $options[] = array('name' => __('Recipe archive posts per page', 'socialchef'), 'desc' => __('Number of recipes to display on recipes archive pages', 'socialchef'), 'id' => 'recipes_archive_posts_per_page', 'std' => '12', 'type' => 'text'); $options[] = array('name' => __('Single meal course permalink slug', 'socialchef'), 'desc' => __('The permalink slug used for single meal course (by default it is set to "meal-course". <br /><strong>Note:</strong> Please make sure you flush your rewrite rules after changing this setting. You can do so by navigating to <a href="/wp-admin/options-permalink.php">Settings->Permalinks</a> and clicking "Save Changes".', 'socialchef'), 'id' => 'meal_course_permalink_slug', 'std' => 'meal-course', 'type' => 'text'); $options[] = array('name' => __('Single recipe category permalink slug', 'socialchef'), 'desc' => __('The permalink slug used for single recipe category (by default it is set to "recipe-category". <br /><strong>Note:</strong> Please make sure you flush your rewrite rules after changing this setting. You can do so by navigating to <a href="/wp-admin/options-permalink.php">Settings->Permalinks</a> and clicking "Save Changes".', 'socialchef'), 'id' => 'recipe_category_permalink_slug', 'std' => 'recipe-category', 'type' => 'text'); $options[] = array('name' => __('Single difficulty permalink slug', 'socialchef'), 'desc' => __('The permalink slug used for single difficulty (by default it is set to "meal-course". <br /><strong>Note:</strong> Please make sure you flush your rewrite rules after changing this setting. You can do so by navigating to <a href="/wp-admin/options-permalink.php">Settings->Permalinks</a> and clicking "Save Changes".', 'socialchef'), 'id' => 'difficulty_permalink_slug', 'std' => 'difficulty', 'type' => 'text'); $options[] = array('name' => __('Single ingredient permalink slug', 'socialchef'), 'desc' => __('The permalink slug used for single ingredient (by default it is set to "meal-course". <br /><strong>Note:</strong> Please make sure you flush your rewrite rules after changing this setting. You can do so by navigating to <a href="/wp-admin/options-permalink.php">Settings->Permalinks</a> and clicking "Save Changes".', 'socialchef'), 'id' => 'ingredient_permalink_slug', 'std' => 'ingredient', 'type' => 'text'); $options[] = array('name' => __('Enable nutritional element info', 'socialchef'), 'desc' => __('Enable use of nutritional element info across the theme', 'socialchef'), 'id' => 'enable_nutritional_elements', 'std' => '1', 'type' => 'checkbox'); $options[] = array('name' => __('Single nutritional element permalink slug', 'socialchef'), 'desc' => __('The permalink slug used for single nutritional element (by default it is set to "meal-course". <br /><strong>Note:</strong> Please make sure you flush your rewrite rules after changing this setting. You can do so by navigating to <a href="/wp-admin/options-permalink.php">Settings->Permalinks</a> and clicking "Save Changes".', 'socialchef'), 'id' => 'nutritional_element_permalink_slug', 'std' => 'nutritional-element', 'type' => 'text'); if (SocialChef_Theme_Utils::is_woocommerce_active()) { $options[] = array('name' => __('WooCommerce', 'socialchef'), 'type' => 'heading'); $page_sidebars = array('' => __('No sidebar', 'socialchef'), 'left' => __('Left sidebar', 'socialchef'), 'right' => __('Right sidebar', 'socialchef'), 'both' => __('Left and right sidebars', 'socialchef')); $options[] = array('name' => __('WooCommerce pages sidebar position', 'socialchef'), 'desc' => __('Select the position (if any) of sidebars to appear on all WooCommerce-specific pages of your website.', 'socialchef'), 'id' => 'woocommerce_pages_sidebar_position', 'std' => 'three', 'type' => 'select', 'class' => 'mini', 'options' => $page_sidebars); } return $options; }
$count++; } if ((int) $recipe_results['results'] % 3 != 0) { echo '</div><!--entries-->'; } ?> <div class="quicklinks"> <a href="javascript:void(0)" class="button scroll-to-top"><?php _e('Back to top', 'socialchef'); ?> </a> </div> <div class="pager"> <?php $total_results = $recipe_results['total']; SocialChef_Theme_Utils::display_pager(ceil($total_results / $posts_per_page)); ?> </div> <?php } else { ?> <div class="alert alert-warning"> <p><?php _e('Malheureusement aucun résultat n\'a été trouvé pour votre critère de recherche. S\'il vous plaît essayez d\'autres critères.', 'socialchef'); ?> </p> </div> <?php } ?> </section><!--//three-fourth-->
function get_group_avatar($avatar) { global $bp, $groups_template; if (strpos($avatar, 'group-avatars')) { return $avatar; } else { $custom_avatar = SocialChef_Theme_Utils::get_file_uri('/images/avatar.jpg'); if ($bp->current_action == "") { return '<img class="avatar" alt="' . esc_attr($groups_template->group->name) . '" src="' . esc_url($custom_avatar) . '" width="' . BP_AVATAR_THUMB_WIDTH . '" height="' . BP_AVATAR_THUMB_HEIGHT . '" />'; } else { return '<img class="avatar" alt="' . esc_attr($groups_template->group->name) . '" src="' . esc_url($custom_avatar) . '" width="' . BP_AVATAR_FULL_WIDTH . '" height="' . BP_AVATAR_FULL_HEIGHT . '" />'; } } }
?> </a></div> </div> </div> </div> </article> <!--//blog post--> <?php } ?> <div class="quicklinks"> <a href="javascript:void(0)" class="button scroll-to-top"><?php _e('Back to top', 'socialchef'); ?> </a> </div> <div class="pager"> <?php SocialChef_Theme_Utils::display_pager($wp_query->max_num_pages); ?> </div> <?php } ?> </section> <?php get_sidebar('right'); ?> </div><!--//row--> <?php get_footer('buddypress');
public function get_theme_logo_src() { $logo_src = of_get_option('website_logo_upload', ''); $logo_src = empty($logo_src) ? SocialChef_Theme_Utils::get_file_uri('/images/ico/logo.png') : $logo_src; return $logo_src; }
/** * Get the base ID of the post (ID of post in default language) * * @access public * @return int */ public function get_base_id() { return apply_filters('socialchef_entity_base_id', $this->post ? SocialChef_Theme_Utils::get_default_language_post_id($this->post->ID, $this->entity_type) : null, $this); }
$sc_is_custom_home = true; } ?> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?> ; charset=<?php bloginfo('charset'); ?> " /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="<?php echo esc_url(SocialChef_Theme_Utils::get_file_uri('/js/html5shiv.js')); ?> "></script> <script src="<?php echo esc_url(SocialChef_Theme_Utils::get_file_uri('/js/respond.min.js')); ?> "></script> <![endif]--> <title><?php wp_title(); ?> </title> <link rel="shortcut icon" href="<?php echo esc_url(SocialChef_Theme_Utils::get_file_uri('/images/favicon.ico')); ?>
public function init() { if (SocialChef_Theme_Utils::is_woocommerce_active()) { add_action('init', array($this, 'woocommerce_init')); } }
function widget($args, $instance) { global $sc_theme_globals; $card_layout_classes = array('full-width', 'one-half', 'one-third', 'one-fourth', 'one-fifth'); extract($args); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : __('Display latest posts', 'socialchef')); $number_of_posts = isset($instance['number_of_posts']) ? (int) $instance['number_of_posts'] : 5; $sort_by = isset($instance['sort_by']) ? (int) $instance['sort_by'] : 'title'; $sort_descending = isset($instance['sort_by']) && $instance['sort_descending'] == '1'; $order = $sort_descending ? 'DESC' : 'ASC'; $post_category_ids = isset($instance['post_category_ids']) ? (array) $instance['post_category_ids'] : array(); $posts_per_row = isset($instance['posts_per_row']) ? (int) $instance['posts_per_row'] : 3; $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] == '1'; $display_mode = isset($instance['display_mode']) ? $instance['display_mode'] : 'small'; echo $before_widget; ?> <!--cwrap--> <div class="cwrap"> <?php /* Display Widget */ $post_args = array('post_type' => 'post', 'post_status' => array('publish'), 'posts_per_page' => $number_of_posts, 'paged' => 1, 'orderby' => $sort_by, 'suppress_filters' => false, 'order' => $order, 'meta_query' => array('relation' => 'AND')); if (count($post_category_ids) > 0) { $numeric_category_ids = array(); foreach ($post_category_ids as $post_category_id) { $numeric_category_ids[] = (int) $post_category_id; } $post_category_ids_str = implode(',', $numeric_category_ids); $post_args['category'] = $post_category_ids_str; } if ($display_mode == 'card') { ?> <header class="s-title"> <?php echo $before_title . $title . $after_title; ?> </header> <?php } else { echo $before_title . $title . $after_title; } $posts_array = get_posts($post_args); if ($display_mode == 'small') { if (count($posts_array) > 0) { ?> <ul class="articles_latest"> <?php for ($i = 0; $i < count($posts_array); $i++) { if (isset($posts_array[$i])) { $article = $posts_array[$i]; $article_permalink = get_permalink($article->ID); $article_title = get_the_title($article->ID); $image_id = get_post_thumbnail_id($article->ID); $image_src = ''; if ($image_id > 0) { $image_src = SocialChef_Theme_Utils::get_image_src($image_id, 'thumbnail'); } ?> <li> <a href="<?php echo esc_url($article_permalink); ?> "> <?php if (!empty($image_src)) { ?> <img src="<?php echo esc_url($image_src); ?> " alt="<?php echo esc_attr($article_title); ?> " /> <?php } ?> <h6><?php echo $article_title; ?> </h6> </a> </li> <?php } } ?> </ul> <?php } } else { if (count($posts_array)) { ?> <!--entries--> <div class="entries row"><?php for ($i = 0; $i < count($posts_array); $i++) { $post_result = $posts_array[$i]; global $post, $sc_post_class; $post = $post_result; setup_postdata($post); $sc_post_class = $card_layout_classes[$posts_per_row - 1]; get_template_part('includes/parts/post', 'item'); } ?> <!--//entries--> <div class="quicklinks"> <a href="<?php echo esc_url($sc_theme_globals->get_blog_posts_root_url()); ?> " class="button"><?php _e('More posts', 'socialchef'); ?> </a> <a href="javascript:void(0)" class="button scroll-to-top"><?php _e('Back to top', 'socialchef'); ?> </a> </div> </div><?php } } ?> </div> <!--//cwrap--> <?php /* After widget (defined by themes). */ echo $after_widget; }
</dl> <?php if (count($ingredient_results) > 0) { ?> <dl class="ingredients"> <?php foreach ($ingredient_results as $ingredient_result) { $ingredient_unit = get_term_by('term_id', $ingredient_result->ingredient_unit_term_id, 'ingredient_unit'); $term_id = $ingredient_result->ingredient_unit_term_id; $term_meta = get_option("taxonomy_{$term_id}"); $unit_abbreviation = $term_meta['ingredient_unit_abbreviation']; $unit_name = empty($unit_abbreviation) ? $ingredient_unit->name : $unit_abbreviation; $ingredient = get_term_by('term_id', $ingredient_result->ingredient_term_id, 'ingredient'); $ingredient_link = get_term_link((int) $ingredient_result->ingredient_term_id, 'ingredient'); echo "<dt>" . SocialChef_Theme_Utils::convert_decimal_to_fraction($ingredient_result->amount) . " {$unit_name}</dt>"; echo "<dd itemprop='ingredients'><a href='" . esc_url($ingredient_link) . "'>" . $ingredient->name . "</a></dd>"; } ?> </dl> <?php } ?> <div class="favorite2"> <a class="" href="<?php get_template_directory_uri(); ?> /pre_prod/contact-2/?a=<?php the_title(); ?>
/** * Display the upload post form */ function upload_form($content_type = 'recipe') { if ($content_type == 'recipe') { $this->_initialize_recipe_fields(); } // Reset postdata in case it got polluted somewhere wp_reset_postdata(); $form_post_id = get_the_id(); $post_id = (int) $form_post_id; ob_start(); ?> <script> window.adminAjaxUrl = '<?php echo home_url() . "/wp-admin/admin-ajax.php"; ?> '; </script> <form action="<?php echo esc_url(admin_url('admin-ajax.php')); ?> " method="post" id="fes-upload-form-<?php echo esc_attr($content_type); ?> " name="fes-upload-form-<?php echo esc_attr($content_type); ?> " class="fes-upload-form fes-form-<?php echo esc_attr($content_type); ?> " enctype="multipart/form-data"> <div class="alert alert-danger" style="display:none"> <?php _e('Errors were encountered when processing your submission. Please correct them and submit again.', 'socialchef'); ?> </div> <?php if (!empty($_GET) && isset($_GET['response']) && ($_GET['response'] == 'fes-sent' || $_GET['response'] == 'fes-recipe-sent' || $_GET['response'] == 'fes-recipe-updated')) { $this->_display_response_notices($_GET); } else { $this->_display_response_notices($_GET); ?> <section> <script> window.enableNutritionalElements = <?php echo esc_js($this->sc_theme_globals->enable_nutritional_elements()); ?> ; window.ingredientQuantityText = '<?php echo esc_js(__('Quantity', 'socialchef')); ?> '; window.ingredientNameText = '<?php echo esc_js(__('Ingredient', 'socialchef')); ?> '; window.nutritionalElementQuantityText = '<?php echo esc_js(__('Quantity', 'socialchef')); ?> '; window.nutritionalElementNameText = '<?php echo esc_js(__('Nutritional element', 'socialchef')); ?> '; window.instructionText = '<?php echo esc_js(__('Enter instruction', 'socialchef')); ?> '; </script> <p><?php _e('Tous les champs sont requis.', 'socialchef'); ?> </p> <?php $atts = array('type' => 'hidden', 'role' => 'internal', 'name' => 'post_author', 'id' => 'fes_post_author', 'value' => $this->get_current_user_id()); echo $this->_render_input($atts); $atts = array('type' => 'hidden', 'role' => 'internal', 'name' => 'content_type', 'id' => 'fes_content_type', 'value' => $content_type); echo $this->_render_input($atts); if ($this->entry_id > 0) { $atts = array('type' => 'hidden', 'role' => 'internal', 'name' => 'entry_id', 'value' => $this->entry_id, 'id' => 'fes_entry_id'); echo $this->_render_input($atts); } $atts = array('type' => 'text', 'role' => 'title', 'name' => 'post_title', 'id' => 'fes_post_title', 'class' => '', 'description' => __('Titre', 'socialchef')); echo '<div class="f-row">'; echo $this->_render_input($atts); echo '</div>'; $this->_render_extra_fields(); ?> </section> <section> <h2><?php _e('Description', 'socialchef'); ?> </h2> <div class="f-row"> <div class="full"> <?php $atts = array('role' => 'content', 'name' => 'post_content', 'id' => 'fes_post_content', 'class' => '', 'description' => __('Description', 'socialchef'), 'wysiwyg_enabled' => true); echo $this->_render_textarea($atts); ?> </div> </div> </section> <section> <h2><?php _e('Photo', 'socialchef'); ?> </h2> <div class="f-row full"> <?php $atts = array('type' => 'file', 'role' => 'file', 'name' => 'featured_image', 'id' => 'fes_featured_image', 'multiple' => false); echo $this->_render_input($atts); ?> </div> <div class="f-row full"> <?php $atts = array('type' => 'submit', 'role' => 'internal', 'name' => 'submitRecipe', 'id' => 'submit_recipe', 'class' => 'button', 'value' => __('Enregistrer cette offre', 'socialchef')); echo $this->_render_input($atts); if (isset($_GET['fesid'])) { $atts = array('type' => 'hidden', 'role' => 'internal', 'name' => 'fesid', 'id' => 'fesid', 'value' => wp_kses($_GET['fesid'], '')); echo $this->_render_input($atts); } $atts = array('type' => 'hidden', 'role' => 'internal', 'name' => 'action', 'id' => 'fes_action', 'value' => 'frontend_recipe_submit'); echo $this->_render_input($atts); wp_nonce_field(FES_NONCE, 'fes_nonce'); ?> <input type="hidden" name="form_post_id" value="<?php echo (int) $form_post_id; ?> " /> <div class="recipe_saving" style="display:none"><img src="<?php echo SocialChef_Theme_Utils::get_file_uri('/images/ico/ajax-loader.gif'); ?> " alt="..." /></div> </div> <?php } ?> <div class="clear"></div> </form> <?php return ob_get_clean(); }
public static function display_pager($max_num_pages) { $pattern = '#(www\\.|https?:\\/\\/){1}[a-zA-Z0-9]{2,254}\\.[a-zA-Z0-9]{2,4}[a-zA-Z0-9.?&=_/]*#i'; $big = 999999999; // need an unlikely integer $pager_links = paginate_links(array('base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $max_num_pages, 'prev_text' => __('<', 'socialchef'), 'next_text' => __('>', 'socialchef'), 'type' => 'array')); $count_links = count($pager_links); if ($count_links > 0) { $first_link = $pager_links[0]; $last_link = $first_link; //var_dump($pager_links); preg_match_all($pattern, $first_link, $matches, PREG_PATTERN_ORDER); if (count($matches) > 0 && isset($matches[0][0])) { echo '<span><a href="' . esc_url($matches[0][0]) . '">' . __('«', 'socialchef') . '</a></span>'; } for ($i = 0; $i < $count_links; $i++) { $pager_link = $pager_links[$i]; if (!SocialChef_Theme_Utils::string_contains($pager_link, 'current')) { echo '<span>' . $pager_link . '</span>'; } else { echo $pager_link; } $last_link = $pager_link; } preg_match_all($pattern, $last_link, $matches, PREG_PATTERN_ORDER); if (count($matches) > 0 && isset($matches[0][0])) { echo '<span><a href="' . esc_url($matches[0][0]) . '">' . __('»', 'socialchef') . '</a></span>'; } } }
* @package WordPress * @subpackage SocialChef * @since SocialChef 1.0 */ get_header('buddypress'); SocialChef_Theme_Utils::breadcrumbs(); get_sidebar('under-header'); global $post; $page_id = $post->ID; $page_custom_fields = get_post_custom($page_id); $page_sidebar_positioning = null; if (isset($page_custom_fields['page_sidebar_positioning'])) { $page_sidebar_positioning = $page_custom_fields['page_sidebar_positioning'][0]; $page_sidebar_positioning = empty($page_sidebar_positioning) ? '' : $page_sidebar_positioning; } if (SocialChef_Theme_Utils::is_a_woocommerce_page()) { global $sc_theme_globals; $page_sidebar_positioning = $sc_theme_globals->get_woocommerce_pages_sidebar_position(); $page_sidebar_positioning = empty($page_sidebar_positioning) ? '' : $page_sidebar_positioning; } $section_class = 'full-width'; if ($page_sidebar_positioning == 'both') { $section_class = 'one-half'; } else { if ($page_sidebar_positioning == 'left' || $page_sidebar_positioning == 'right') { $section_class = 'three-fourth'; } } ?> <div class="row"> <?php
</div> <?php } else { ?> <div class="alert alert-danger"> <?php _e('Une erreur est survenue lors de la tentative d\'envoyer le lien d\'activation . Veuillez réessayer plus tard.', 'socialchef'); ?> </div> <?php } } else { ?> <form action="<?php echo SocialChef_Theme_Utils::get_current_page_url(); ?> " id="register-form" method="post"> <?php if (isset($errors) && count($errors) > 0) { ?> <div class="alert alert-danger"><?php _e('Des erreurs ont été rencontrées au cours du traitement de formulaire d\'inscription . Veuillez réessayer.', 'socialchef'); ?> </div> <?php } ?> <div class="f-row"> <input type="text" id="first_name" name="first_name" placeholder=" Prénom" value="" />
<?php /** /* Template Name: 404 page * * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage SocialChef * @since SocialChef 1.0 */ get_header('buddypress'); SocialChef_Theme_Utils::breadcrumbs(); get_sidebar('under-header'); global $sc_theme_globals; ?> <!--row--> <div class="row"> <!--content--> <section class="content three-fourth"> <!--row--> <div class="row"> <div class="one-third"> <div class="error-container"> <span class="error_type"><?php _e('404', 'socialchef'); ?> </span> <span class="error_text"><?php _e('Page not found', 'socialchef'); ?>
require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-home-intro.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-recipe-categories.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-post-list.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-recipe-list.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-featured-recipe.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-featured-member.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget-share.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/plugins/widgets/widget_mnb_banner.php'); // /*-----------------------------------------------------------------------------------*/ // /* Load Utilities & Ajax & Custom Post Types & metaboxes // /*-----------------------------------------------------------------------------------*/ require_once SocialChef_Theme_Utils::get_file_path('/includes/theme_ajax.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/theme_post_types.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/theme_meta_boxes.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/post_types/recipe.class.php'); require_once SocialChef_Theme_Utils::get_file_path('/includes/post_types/post.class.php'); if (function_exists('register_sidebar')) { register_sidebar(array('name' => 'offre Sidebar', 'id' => 'offre-sidebar', 'description' => 'Appears as the sidebar on the custom offre', 'before_widget' => '<div ></div><li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>')); } //gsm Comment add_action('comment_post', 'save_comment_meta'); function save_comment_meta($comment_id) { add_comment_meta($comment_id, 'gsm', $_POST['gsm'], true); } //user extra filds function modify_contact_methods($profile_fields) { // Add new fields $profile_fields['Raison_Social'] = 'Raison Social'; $profile_fields['Adresse'] = 'Adresse';
function admin_enqueue_scripts() { wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('jquery-ui-droppable'); wp_enqueue_script('jquery-ui-draggable'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-ui-selectable'); wp_enqueue_script('jquery-ui-autocomplete'); wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('jquery-ui-dialog'); wp_enqueue_script('jquery-ui-spinner'); wp_enqueue_script('jquery-effects-core'); wp_register_script('socialchef-admin', SocialChef_Theme_Utils::get_file_uri('/includes/admin/admin.js'), false, '1.0.0'); wp_enqueue_script('socialchef-admin'); wp_register_script('socialchef-widgets', SocialChef_Theme_Utils::get_file_uri('/includes/admin/widgets.js'), false, '1.0.0'); wp_enqueue_script('socialchef-widgets'); wp_enqueue_style('socialchef-admin-css', SocialChef_Theme_Utils::get_file_uri('/css/admin-custom.css'), false); wp_enqueue_style('socialchef-admin-ui-css', SocialChef_Theme_Utils::get_file_uri('/css/jquery-ui.min.css'), false); }
function widget($args, $instance) { global $sc_recipes_post_type, $sc_theme_globals; $card_layout_classes = array('full-width', 'one-half', 'one-third', 'one-fourth', 'one-fifth'); extract($args); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : __('Display latest recipes', 'socialchef')); $number_of_recipes = isset($instance['number_of_recipes']) ? (int) $instance['number_of_recipes'] : 5; $sort_by = isset($instance['sort_by']) ? (int) $instance['sort_by'] : 'title'; $sort_descending = isset($instance['sort_by']) && $instance['sort_descending'] == '1'; $order = $sort_descending ? 'DESC' : 'ASC'; $recipe_category_ids = isset($instance['recipe_category_ids']) ? (array) $instance['recipe_category_ids'] : array(); $recipe_difficulty_ids = isset($instance['recipe_difficulty_ids']) ? (array) $instance['recipe_difficulty_ids'] : array(); $recipe_meal_course_ids = isset($instance['recipe_meal_course_ids']) ? (array) $instance['recipe_meal_course_ids'] : array(); $recipes_per_row = isset($instance['recipes_per_row']) ? (int) $instance['recipes_per_row'] : 3; $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] == '1'; $display_mode = isset($instance['display_mode']) ? $instance['display_mode'] : 'small'; echo $before_widget; /* Display Widget */ $recipe_results = $sc_recipes_post_type->list_recipes(1, $number_of_recipes, $sort_by, $order, $recipe_meal_course_ids, $recipe_difficulty_ids, array(), array(), array(), $show_featured_only); ?> <!--cwrap--> <div class="cwrap"> <?php if ($display_mode == 'card') { ?> <header class="s-title"> <?php echo $before_title . $title . $after_title; ?> </header> <?php } else { echo $before_title . $title . $after_title; } if ($display_mode == 'small') { if (count($recipe_results) > 0 && $recipe_results['total'] > 0) { ?> <ul class="articles_latest recipes_latest"> <?php $recipes = $recipe_results['results']; for ($i = 0; $i < count($recipes); $i++) { if (isset($recipes[$i])) { $recipe = $recipes[$i]; $recipe_permalink = get_permalink($recipe->ID); $recipe_title = get_the_title($recipe->ID); $image_id = get_post_thumbnail_id($recipe->ID); $image_src = ''; if ($image_id > 0) { $image_src = SocialChef_Theme_Utils::get_image_src($image_id, 'thumbnail'); } ?> <li> <a href="<?php echo esc_url($recipe_permalink); ?> "> <?php if (!empty($image_src)) { ?> <img src="<?php echo esc_url($image_src); ?> " alt="<?php echo esc_attr($recipe_title); ?> " /> <?php } ?> <h6><?php echo $recipe_title; ?> </h6> </a> </li> <?php } } ?> </ul> <?php } } else { if (count($recipe_results) > 0 && $recipe_results['total'] > 0) { ?> <!--entries--> <div class="entries row"><?php $recipes = $recipe_results['results']; for ($i = 0; $i < count($recipes); $i++) { if (isset($recipes[$i])) { $recipe = $recipes[$i]; global $post, $sc_recipe_class; $post = $recipe; setup_postdata($post); $sc_recipe_class = $card_layout_classes[$recipes_per_row - 1]; get_template_part('includes/parts/recipe', 'item'); } } ?> <!--//entries--> <div class="quicklinks"> <a href="/consulter-nos-offres" class="button"><?php _e('Toutes nos offres', 'socialchef'); ?> </a> <a href="javascript:void(0)" class="button scroll-to-top"><?php _e('Haut', 'socialchef'); ?> </a> </div> </div><?php } } ?> </div> <!--//cwrap--> <?php /* After widget (defined by themes). */ echo $after_widget; }