the_post(); ?> <?php get_template_part('includes/loop', $themify->query_post_type); ?> <?php } ?> </div> <!-- /loops-wrapper --> <?php if (themify_is_query_page() && 'section' != $themify->query_post_type) { ?> <?php if ($themify->page_navigation != 'yes') { ?> <?php get_template_part('includes/pagination'); ?> <?php } ?> <?php } ?> <?php
/** * Checks if WPML is active and if so, sets the correct page number. * * @since 1.7.3 * @since 2.3.7 Only applied to query pages. * @param $wp_query */ function themify_wpml_pagination_setup($wp_query) { if (themify_is_query_page()) { $paged = 1; if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } set_query_var('paged', $paged); } }
/** * Function that checks if meta data exists and retrieves it, otherwise checks theme setting and retrieves it instead. * If it still doesn't exist, uses the default provided. * * @since 1.0.0 * * @param string $meta * @param string $default * @param string $theme_setting * * @return mixed */ function themify_theme_get($meta, $default = '', $theme_setting = '') { global $themify; $post_type = ''; // If it's a singular view or a query page, try to get the post meta data first if (themify_is_query_page()) { // Let's check now prefixing with post type since it's a query post type page // Check without checking for custom post type $value = get_post_meta($themify->page_id, $meta, true); if ('' != $themify->query_post_type && 'post' != $themify->query_post_type) { $post_type = $themify->query_post_type . '_'; $cpt_meta = $post_type . $meta; $value = get_post_meta($themify->page_id, $cpt_meta, true); } else { } if ($value && '' != $value && 'default' != $value) { return $value; } } elseif (is_singular()) { // Check first without checking for custom post type $value = get_post_meta(get_the_ID(), $meta, true); if ($value && '' != $value && 'default' != $value) { return $value; } // Let's check now prefixing with post type if ('post' != get_post_type() && 'page' != get_post_type()) { $post_type = get_post_type() . '_'; } $cpt_meta = $post_type . $meta; $value = get_post_meta(get_the_ID(), $cpt_meta, true); if ($value && '' != $value && 'default' != $value) { return $value; } } // If there is no post meta data or is '' (default), prepare to fetch theme setting if (empty($theme_setting)) { if (themify_is_query_page() && '' != $themify->query_post_type && 'post' != $themify->query_post_type) { $post_type = $themify->query_post_type . '_'; } elseif (is_singular() && ('post' != get_post_type() && 'page' != get_post_type())) { $post_type = get_post_type() . '_'; } $theme_setting = 'setting-' . $post_type . $meta; } // Check theme setting (if there's a special setting like for portfolios it will be checked) if (themify_check($theme_setting)) { return themify_get($theme_setting); } // Prepare to check non special setting stripping out the post type from setting key if ('post' != $post_type) { $theme_setting = str_replace($post_type, '', $theme_setting); } // Check regular setting (like portfolios that rely in default layouts setting) if (themify_check($theme_setting)) { return themify_get($theme_setting); } // No luck so return default return $default; }
the_post(); ?> <?php get_template_part('includes/loop', $themify->query_post_type); ?> <?php } ?> </div> <!-- /loops-wrapper --> <?php if (themify_is_query_page()) { ?> <?php if ($themify->page_navigation != 'yes') { ?> <?php get_template_part('includes/pagination'); ?> <?php } // show page navigation ?> <?php } // is query page ?>
/** * Returns escaped URL for featured image link * @return string * @since 1.3.5 */ function themify_get_featured_image_link($args = array()) { $defaults = array('no_permalink' => false); $args = wp_parse_args($args, $defaults); extract($args, EXTR_SKIP); if (themify_get('external_link') != '') { $link = esc_url(themify_get('external_link')); } elseif (themify_get('lightbox_link') != '') { $link = esc_url(themify_get('lightbox_link')); if (themify_check('iframe_url')) { $link = themify_get_lightbox_iframe_link($link); } $link = $link . '" class="lightbox'; } elseif (themify_check('link_url')) { $link = themify_get('link_url'); } elseif ($args['no_permalink']) { $link = ''; } else { $link = get_permalink(); if (current_theme_supports('themify-post-in-lightbox')) { if (!is_single() && '' != themify_get('setting-open_inline')) { $link = add_query_arg(array('post_in_lightbox' => 1), get_permalink()) . '" class="themify-lightbox'; } if (themify_is_query_page()) { if ('no' == themify_get('post_in_lightbox')) { $link = get_permalink(); } else { $link = add_query_arg(array('post_in_lightbox' => 1), get_permalink()) . '" class="themify-lightbox'; } } } } return apply_filters('themify_get_featured_image_link', $link); }