/** * NBA FUNCTIONALITY * Become Member Shortcode * * @package NBA-Functionality * @since 1.0.0 */ function nba_shortcode_become_member($atts) { //-- GET META --// $join_id = get_id_by_slug('join'); $meta['button_text'] = get_field('join_cta_button_text', $join_id); $meta['button_link'] = get_field('join_cta_button_link', $join_id); $meta['benefits'] = get_field('join_cta_benefits', $join_id); $out = ''; $out .= '<section class="become-member-cta">'; // BUTTON if ($meta['button_text'] && $meta['button_link']) { $out .= '<a class="button" href="' . $meta['button_link'] . '">' . $meta['button_text'] . '</a>'; } // button; // BENEFITS if ($meta['benefits']) { $out .= '<ul class="checklist green">'; foreach ($meta['benefits'] as $benefit) { $out .= '<li>' . $benefit['benefit'] . '</li>'; } // foreach $out .= '</ul>'; } // benefits $out .= '</section><!-- .become-member-cta -->'; return $out; }
function check_username_password($login, $username, $password) { // Getting URL of the login page $referrer = $_SERVER['HTTP_REFERER']; // if there's a valid referrer, and it's not the default log-in screen if (!empty($referrer) && !strstr($referrer, 'wp-login') && !strstr($referrer, 'wp-admin')) { if ($username == "" || $password == "") { wp_redirect(get_permalink(get_id_by_slug("members-login")) . "?login=empty"); exit; } } }
function cmb2_video_metaboxes() { // Start with an underscore to hide fields from custom fields list $prefix = 'medialoft_'; $galleriesPageId = get_id_by_slug('video-galleries'); /** * Initiate the Copy metabox */ $cmb_gallery = new_cmb2_box(array('id' => 'gallery_video_ids', 'title' => __('Gallery Videos', 'cmb2'), 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_on' => array('key' => 'child_of', 'value' => array($galleriesPageId)), 'show_names' => true, 'open' => true)); // Regular text field $cmb_gallery->add_field(array('name' => __('Ids', 'cmb2'), 'desc' => __('Please enter a comma separated list of IDs', 'cmb2'), 'id' => $prefix . 'video_ids', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats')); /** * Initiate the Copy metabox */ $cmb = new_cmb2_box(array('id' => 'video_metabox', 'title' => __('Video Urls', 'cmb2'), 'object_types' => array('video'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'open' => true)); // Regular text field $cmb->add_field(array('name' => __('Desktop URL', 'cmb2'), 'desc' => __('Please enter desktop video url', 'cmb2'), 'id' => $prefix . 'desktop_url', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats')); // Regular text field $cmb->add_field(array('name' => __('Mobile URL', 'cmb2'), 'desc' => __('Please enter mobile video url', 'cmb2'), 'id' => $prefix . 'mobile_url', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats')); $cmb2 = new_cmb2_box(array('id' => 'video_poster_metabox', 'title' => __('Poster Image', 'cmb2'), 'object_types' => array('video'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'open' => true)); $cmb2->add_field(array('name' => 'Poster Image', 'desc' => 'Upload an image that will show as the video poster.', 'id' => $prefix . 'video_poster', 'type' => 'file', 'options' => array('url' => false, 'add_upload_file_text' => 'Add Poster Image'))); }
echo home_url(); ?> "> <img src="<?php echo get_template_directory_uri() . '/public/img/logo_email.jpg'; ?> "/> </a> </div> <p>Dear <?php echo $user_lastname; ?> ,<br /><br /> Welcome to The Curtain Boutique. To log in, click <a href="<?php echo get_the_permalink(get_id_by_slug('members-login')); ?> ">Login</a> and then enter your username and password.</p> <p>Username: <?php echo $user_login; ?> </p> <p>Password: <?php echo $plaintext_pass; ?> <br /> <br /> When you log in to your account, you will be able to do the following:</p>
<?php /** * Staffing Needs Archive * * This is the template for the staffing needs page. */ $page_id = get_id_by_slug('staffing-needs'); get_header(); ?> <div class="row staffing-needs-container"> <div class="large-8 columns"> <h1><?php echo get_the_title($page_id); ?> </h1> <?php echo apply_filters('the_content', get_post_field('post_content', $page_id)); ?> <?php $staff_needs = new WP_Query('post_type=staffing_needs'); // Loop through all Staffing Needs if ($staff_needs->have_posts()) { echo '<ul class="small-block-grid-2 medium-block-grid-3 staffing-needs-preview-container">'; while ($staff_needs->have_posts()) { $staff_needs->the_post(); echo '<li>'; echo '<a href="#' . $post->post_name . '">';
<?php get_header(); $imageFolder = get_bloginfo('template_directory') . '/images/'; $homeId = get_id_by_slug('home'); $fields = $fields = get_fields($homeId); $imageFolder = get_bloginfo('template_directory') . '/images/'; $heroImages = $fields['hero_images']; $random = array_rand($heroImages, 1); $heroImage = $heroImages[$random]['hero_image']; ?> <section id="home-hero" class="row"> <div class="image" style="background-image: url(<?php echo $heroImage; ?> );"> <img class="off-screen" src="<?php echo $heroImage; ?> "/> <div class="cover"></div> </div> <div class="border"></div> <h1 id="logo-lrg"><img src="<?php echo $imageFolder . 'logo_white.svg'; ?> " alt="Andy DuCett"/></h1> <div class="scroll-indicator"></div> </section>
<?php } //else ?> </div> <!-- article content --> <?php if (is_user_logged_in()) { ?> <div class="point-accumulated"> <h4>Point accumulated</h4> <div class="point"><?php echo esc_attr(get_the_author_meta('point', get_current_user_id())); ?> </div> <a href="<?php echo get_permalink(get_id_by_slug("rewards")); ?> " class="submit-button-tcb">Get more points</a> <a href="#" class="redeem-confirm submit-button-tcb">Redeem gift</a> <div><img class="submit-loading" src="<?php echo get_template_directory_uri() . '/assets/img/ajax-loader.gif'; ?> "/></div> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <div class="article-content redeem-remove"> <?php the_content();
_e('Sorry, but the page you were trying to view does not exist.', 'aiga_nebraska'); ?> </div> <?php get_search_form(); } else { /* User does exist! */ while (have_posts()) { the_post(); ?> <?php $gravatar_base = 'http://www.gravatar.com/avatar/' . md5($user_object->user_email); ?> <?php $hero_bg = get_field('hero_background_image', get_id_by_slug('home')); ?> <?php $hero_bg = wp_get_attachment_image_src($hero_bg, 'full')[0]; ?> <?php $gravatar_base .= '?d=' . urlencode($hero_bg) . '&r=pg'; ?> <?php $small_version = $gravatar_base . '&s=400'; ?> <?php $medium_version = $gravatar_base . '&s=800'; ?> <?php $large_version = $gravatar_base . '&s=1200';
<?php /** * Annual Reports Page Template * This page template displays all of the programs * we offer. * * Template Name: Annual Reports */ // Get Page ID from the slug $page_id = get_id_by_slug('annual-reports'); get_header(); // The Query $annual_reports = new WP_Query('post_type=page&page_category=annual-report'); ?> <script> $(document).ready( function() { if ($('body').hasClass('touch')) { console.log('working'); } }); </script> <div class="row annual-reports-archive-container"> <div class="medium-8 columns"> <?php if (have_posts()) { while (have_posts()) { the_post();
<?php // Archive for Surges $page_id = get_id_by_slug('the-surge'); query_posts("p={$page_id}&post_type=page"); get_header(); // Begin looping through custom page content if (have_posts()) { while (have_posts()) { the_post(); ?> <div class="row"> <div class="columns medium-8"> <?php the_content(); ?> </div> <aside id="sidebar" class="columns medium-4 stick-to-parent"> <?php // List all active surge initiatives $the_query = new WP_Query('post_type=surges'); // The Loop if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); echo '<a href="' . get_permalink() . '">'; echo '<div class="surge-archive-active-container">'; if (has_post_thumbnail()) {
<?php /** * Program Archive Page Template * This page template displays all of the programs * we offer. * * Template Name: Programs Archive */ // Get Page ID from the slug $page_id = get_id_by_slug('programs'); // Get all program classifications $program_classifications = get_terms('program_classification'); get_header(); ?> <div class="row"> <div class="medium-9 columns archive-program-content-container entry"> <h1><?php echo get_the_title($page_id); ?> </h1> <?php echo get_post_field('post_content', $page_id); ?> <?php
<?php echo get_id_by_slug("/produtos/panela-do-pet-450g-cao-senior-gado"); function get_id_by_slug($page_slug) { $page = get_page_by_path($page_slug)->ID; return "ooi"; /*if ($page) { return "ooi"; } else { return "ooi";*/ }
<?php /** * Blog Template * This displays all of the different blog views for * the site. */ $page_id = get_id_by_slug('blog'); get_header(); ?> <div class="row content-archive-container"> <div class="small-12 large-8 columns" role="main"> <?php get_template_part('parts/archive_header'); ?> <?php if (have_posts()) { ?> <?php do_action('watertower_before_content'); ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content');
<div class="row"> <div class="medium-4 columns"> <img src="<?php echo get_bloginfo('template_url'); ?> /assets/img/images/surge_logo.png" /> <a href="<?php echo get_permalink(get_id_by_slug('the-surge')); ?> " class="button show-for-medium-up">More Info</a> </div> <div class="medium-8 columns"> <h2>The Surge</h2> <p>“The Surge” is a laser-like strategy that will partner with one Target Nation for 3-5 years at a time to meet mutually agreed upon, God-given goals. We may be able to coordinate a Surge in 2-3 different Target Nations at the same time (all at different stages in their Surge timelines) depending on what the goal/strategy is that we are partnering alongside.</p> <a href="<?php echo get_permalink(get_id_by_slug('the-surge')); ?> " class="button show-for-small-only">More Info</a> </div> </div> </div> <?php $the_query = new WP_Query('post_type=target_nations'); // Loop through Target Nations if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); echo '<div class="target-nation-container">'; $country_id = rwmb_meta('country_id', '', $post->ID);
invoice_no :"required", date_of_installation :"required", email: { required: true, email: true } }, messages: { email: "Please enter a valid email address" }, invalidHandler: function(event, validator) { $("#warranty_form .submit-loading").fadeToggle(); } }); setTimeout(function(){ $('.feedback_popup').bPopup({ fadeSpeed : 'slow', speed : 500, modalClose : false, escClose: false }); }, 3000); }) function warranty_form_redirect(){ var url = "<?php echo get_permalink(get_id_by_slug("thank-you-for-your-registration")); ?> "; window.location.href = url; } </script>
/** * Template Name: */ get_header(); ?> <div class="container"> <div class="data-center"> <div class="article-wp"> <?php $slug = ""; if (ICL_LANGUAGE_CODE == "en") { $slug = "404-page"; } else { $slug = "trang-404"; } $postID = get_id_by_slug($slug); $postObj = get_post($postID); setup_postdata($postObj); ?> <div class="content_404"> <?php echo the_content(); ?> </div> </div> </div> </div> <?php get_footer();
<div class="section-input outer-button"> <input type="submit" value="Join now" class="cd-popup-trigger submit-butt"/> <a href="<?php echo home_url(); ?> " class="submit-button-tcb popup-referral">Maybe next time</a> <img class="submit-loading" src="<?php echo plugins_url('../assets/css/images/ajax-loader.gif', __FILE__); ?> "/> </div> </div><!--/tcp form --> <script> function referral_form_redirect(){ var url = "<?php echo get_permalink(get_id_by_slug("thank-you-for-your-referral")); ?> "; window.location.href = url; } jQuery(document).ready(function($){ $(".submit-butt").on('click', function(event){ $(".submit-loading").fadeToggle(); }); $(".wpcf7-form").validate({ rules: { email_1: { email: true }, email_2: { email: true
<?php /** Template Name: Referral Form Template */ if (!is_user_logged_in()) { wp_redirect(get_permalink(get_id_by_slug("members-login"))); exit; } get_header(); if (!post_password_required()) { $featured = jeg_get_page_featured_heading(1200, 750); ?> <div class="headermenu"> <?php jeg_get_template_part('template/rightheader'); ?> </div> <!-- headermenu --> <div class="contentheaderspace"></div> <div class="pagewrapper <?php echo vp_metabox('jkreativ_page_heading.heading_position', 'inside'); ?> <?php echo vp_metabox('jkreativ_page_pageposition.page_width', 'fullwidth'); ?> <?php echo vp_metabox('jkreativ_page_pageposition.page_position', 'pagecenter'); ?> <?php echo vp_metabox('jkreativ_page_pageposition.blog_layout', 'nosidebar');
function jp_exclude_pages_from_admin($query) { $pagesToExclude = array(get_id_by_slug('blog'), get_id_by_slug('about'), get_id_by_slug('home'), get_id_by_slug('services'), get_id_by_slug('work')); ?> <?php if (!is_admin()) { return $query; } global $pagenow, $post_type; if (!current_user_can('administrator') && $pagenow == 'edit.php' && $post_type == 'page') { $query->query_vars['post__not_in'] = $pagesToExclude; } // Enter your page IDs here }
<?php while (have_posts()) { the_post(); ?> <section class="hero" <?php responsive_bg(get_field('hero_background_image', get_id_by_slug('home'))); ?> > <div class="container"> <div class="column"> <?php the_field('hero_content'); ?> </div> </div> </section> <section> <div class="container"> <?php if (have_rows('faqs')) { ?> <?php while (have_rows('faqs')) { the_row(); ?> <div class="column twelve"> <h2><?php the_sub_field('category'); ?> </h2>
<?php get_header(); ?> <header class="page-header wow slideInDown" data-wow-duration="0.5s" data-wow-delay="1s" <?php $careers_page = get_id_by_slug('careers'); $title = get_field('title', $careers_page); $title_color = get_field('title_color', $careers_page); $subtitle = get_field('subtitle', $careers_page); $subtitle_color = get_field('subtitle_color', $careers_page); $add_word_slider = get_field('add_word_slider', $careers_page); $static_title = get_field('static_title', $careers_page); $rotating_words_color = get_field('rotating_words_color', $careers_page); $rotating_words_background_color = get_field('rotating_words_background_color', $careers_page); $static_title_color = get_field('static_title_color', $careers_page); $background_image = get_field('background_image', $careers_page); $background_color = get_field('background_color', $careers_page); if ($background_image) { echo 'style="background: url(' . $background_image . ') center no-repeat; background-size: cover;"'; } else { echo 'style="background: ' . $background_color . ';"'; } ?> > <div class="page-header-inner"> <?php if ($add_word_slider == 1) { ?> <h1 class="page-header-title has-word-rotator"> <div class="static-title" <?php if ($static_title_color) {
<?php $postid = get_id_by_slug("portada"); $args = array('name' => 'portada', 'post_type' => 'page', 'p' => $postid); query_posts($args); if (have_posts()) { ?> <div class="sectionListItem"> <?php while (have_posts()) { the_post(); ?> <?php if (have_rows('post_list')) { ?> <?php while (have_rows('post_list')) { the_row(); $post_object = get_sub_field('page_title'); $post_text = get_sub_field('cabecera'); $page_style = get_sub_field('page_style'); $page_size = get_sub_field('page_size'); ?> <?php global $post; if ($post_object) { $post = $post_object; setup_postdata($post); ?> <div class="sectionItem sectionItem--<?php echo $page_size;
<nav class="nav is-hidden"> <ul class="nav__primary no-pp"> <?php if (is_user_logged_in()) { ?> <li class="nav__item"><span class="nav__item__title">Espace adhérents</span> <ul class="nav__dropdown"> <span class="container"> <?php wp_list_pages(array('title_li' => '', 'depth' => 1, 'child_of' => get_id_by_slug('espace-adherents'))); ?> </span> </ul> </li> <?php } ?> <?php $main_menus = get_field('main_menu', 'option'); if ($main_menus) { foreach ($main_menus as $post_object) { $main_page_id = $post_object['main_page']; ?> <li class="nav__item"><span class="nav__item__title"><?php echo get_the_title($main_page_id); ?> </span> <ul class="nav__dropdown">
function tcb_profile_load_scripts_front() { wp_register_style('tcb_style_front-css', plugins_url('/assets/css/style_front.css', __FILE__)); wp_enqueue_style('tcb_style_front-css'); // Enqueue it! $detect = new Mobile_Detect(); if ($detect->isiOS()) { wp_register_style('tcb_style_front-ios-css', plugins_url('/assets/css/style_ios_front.css', __FILE__)); wp_enqueue_style('tcb_style_front-ios-css'); // Enqueue it! } wp_register_script('tcb_frontjs', plugins_url('/assets/js/scripts_front.js', __FILE__), array('jquery')); wp_enqueue_script('tcb_frontjs'); wp_localize_script('tcb_frontjs', 'MyAjax', array('ajaxurl' => admin_url('admin-ajax.php'), 'loginurl' => get_permalink(get_id_by_slug("members-login")))); }
?> </div><!--/col-md-4--> <!-- End Link List --> <!-- Address --> <div class="col-md-4 col-md-offset-1 map-img"> <?php function get_id_by_slug($page_slug) { $page = get_page_by_path($page_slug); if ($page) { return $page->ID; } else { return null; } } $slug = get_id_by_slug('contact_us'); ?> <div class="headline"><h2>Contact Us</h2></div> <address> <?php if (get_field('sidebar_address', $slug, true) !== "") { ?> <div> <a href="#"> <i class="fa fa-home"></i> <?php echo get_field('sidebar_address', $slug, true); ?> </a> </div> <?php
?> > <div class="container"> <div class="column"> <?php the_field('hero_content'); ?> </div> </div> </section> <section class="judges-details"> <?php if (have_rows('judges', get_id_by_slug('home'))) { ?> <?php while (have_rows('judges', get_id_by_slug('home'))) { the_row(); ?> <?php $judge = get_sub_field('judge'); ?> <div id="judge-<?php echo $judge['user_nicename']; ?> " class="container bleed one-half"> <div class="column judge has-sizer" <?php responsive_bg(get_field('profile_photo', 'user_' . $judge['ID'])); ?> > <div class="content kitchensink"> <span class="h2"><?php