function zp_custom_archive_page()
{
    global $post, $paged;
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
    //* Genesis navigation
    genesis_posts_nav();
    //* Restore original query
    wp_reset_query();
}
Esempio n. 2
0
function cuttz_bbpress_layout($layout)
{
    if (!is_bbpress()) {
        return $layout;
    }
    //get current layout saved in genesis setting
    $gsettings = get_option(GENESIS_SETTINGS_FIELD, null);
    $layout = isset($gsettings['site_layout']) ? $gsettings['site_layout'] : null;
    $set = genesis_get_option('bbpress-layout', cuttz_get_skin_page_id(), false);
    $set = $set == 'default' ? $layout : $set;
    // if no setting in Cuttz defined then use Genesis setting
    $forum_id = bbp_get_forum_id();
    $forumlayout = false;
    if (!empty($forum_id)) {
        $forumlayout = esc_attr(get_post_meta($forum_id, '_genesis_layout', true));
        if (!empty($forumlayout)) {
            return $forumlayout;
        }
    }
    if (empty($forumlayout)) {
        return $set;
    }
    if (is_user_logged_in()) {
    }
    return $set;
}
Esempio n. 3
0
function wsm_child_do_footer()
{
    echo '<div class="footer-left">';
    $contact = genesis_get_option('wsm_contact_info', 'patricia-settings');
    if (!empty($contact)) {
        echo '<p class="contact-info">' . genesis_get_option('wsm_contact_info', 'patricia-settings') . '</p>';
    }
    $credit = genesis_get_option('wsm_credit', 'patricia-settings');
    if (!empty($contact)) {
        echo '<p class="credit">' . genesis_get_option('wsm_credit', 'patricia-settings') . '</p>';
    }
    echo '</div><!-- end .footer-left -->';
    echo '<div class="footer-right">';
    if (has_nav_menu('footer')) {
        $args = array('theme_location' => 'footer', 'container' => '', 'menu_class' => genesis_get_option('nav_superfish') ? 'nav genesis-nav-menu superfish' : 'nav genesis-nav-menu', 'echo' => 0);
        $nav = wp_nav_menu($args);
    }
    $nav_output = sprintf('<div class="footer-nav">%2$s%1$s%3$s</div>', $nav, genesis_structural_wrap('nav', '<div class="menu-wrap">', 0), genesis_structural_wrap('nav', '</div><!-- end .wrap -->', 0));
    echo apply_filters('wsm_do_footer_nav', $nav_output, $nav, $args);
    $copyright = genesis_get_option('wsm_copyright', 'patricia-settings');
    if (!empty($copyright)) {
        echo '<p class="copy">' . genesis_get_option('wsm_copyright', 'patricia-settings') . '</p>';
    }
    echo '</div><!-- end .footer-right -->';
}
function zp_custom_blog_page()
{
    global $post, $paged;
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    if (get_query_var('paged')) {
        $paged = get_query_var('paged');
    } elseif (get_query_var('page')) {
        $paged = get_query_var('page');
    } else {
        $paged = 1;
    }
    //* Arguments
    $args = array('cat' => $include, 'category__not_in' => $exclude, 'posts_per_page' => genesis_get_option('blog_cat_num'), 'paged' => $paged);
    query_posts($args);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
    //* Genesis navigation
    genesis_posts_nav();
    //* Restore original query
    wp_reset_query();
}
/**
 * Filters the body classes to add the proper style-specific class.
 *
 */
function associate_style_body_class($classes)
{
    if ($style = genesis_get_option('style_selection')) {
        $classes[] = esc_attr(sanitize_html_class($style));
    }
    return $classes;
}
function genesis_upgrade()
{
    // Don't do anything if we're on the latest version
    if (version_compare(genesis_get_option('theme_version'), PARENT_THEME_VERSION, '>=')) {
        return;
    }
    #########################
    #	UPGRADE TO VERSION 1.0.1
    #########################
    // Check to see if we need to upgrade to 1.0.1
    if (version_compare(genesis_get_option('theme_version'), '1.0.1', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('nav_home' => 1, 'nav_twitter_text' => 'Follow me on Twitter', 'subnav_home' => 1, 'theme_version' => '1.0.1');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
    #########################
    #	UPGRADE TO VERSION 1.0.2
    #########################
    // Check to see if we need to upgrade to 1.0.2
    if (version_compare(genesis_get_option('theme_version'), '1.0.2', '<')) {
        $theme_settings = get_option(GENESIS_SETTINGS_FIELD);
        $new_settings = array('theme_version' => '1.0.2');
        $settings = wp_parse_args($new_settings, $theme_settings);
        update_option(GENESIS_SETTINGS_FIELD, $settings);
    }
}
function bsg_genesis_next_link_text_numeric($text)
{
    if ('numeric' === genesis_get_option('posts_nav')) {
        return '<span class="sr-only">' . __('Next Page', 'genesis') . '</span>' . '<span aria-hidden="true">&raquo;</span>';
    }
    return $text;
}
function custom_genesis_do_author_box()
{
    if (is_single() && genesis_get_option('author_box_single')) {
        genesis_author_box();
        return;
    }
}
Esempio n. 9
0
function post_format_image_featured()
{
    if (has_post_format('image') && has_post_thumbnail() && is_singular('post')) {
        $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'attr' => array('class' => 'post-image')));
        printf('<a href="%s" id="featured-post-image" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img);
    }
}
Esempio n. 10
0
function decor_add_nav_body_class($classes)
{
    if (genesis_get_option('nav')) {
        $classes[] = 'primary-nav';
    }
    return $classes;
}
function uci_genesis_set_logo()
{
    $uci_logo_path = get_theme_mod('uci_custom_logo');
    if (genesis_get_option('blog_title') == 'image' && get_theme_mod('uci_custom_logo')) {
        echo '<div class="site-logo"><a href="' . site_url() . '"><img src="' . $uci_logo_path . '" alt="' . get_bloginfo('name') . '" /></a></div>';
    }
}
function socialeyes_style_body_class($classes)
{
    if ($style = genesis_get_option('style_selection')) {
        $classes[] = $style;
    }
    return $classes;
}
/**
 * Replacement for genesis_posts_nav() that replaces the call to
 * genesis_prev_next_posts_nav() with
 * bsg_genesis_prev_next_posts_nav()
 *
 * @since 0.7.0
 */
function bsg_genesis_posts_nav()
{
    if ('numeric' === genesis_get_option('posts_nav')) {
        bsg_genesis_numeric_posts_nav();
    } else {
        bsg_genesis_prev_next_posts_nav();
    }
}
Esempio n. 14
0
 /**
  * Render the Metabox
  *
  * @since 1.0.3
  *
  * @author Bill Erickson
  * @link http://www.billerickson.net/genesis-theme-options/
  * @return null
  */
 public function render_metabox()
 {
     $number_of_widgets = genesis_get_option('footer_widgets');
     $number_of_widgets = is_numeric($number_of_widgets) ? intval($number_of_widgets) : 0;
     if (is_readable($this->config['views']['metabox'])) {
         include $this->config['views']['metabox'];
     }
 }
/**
 * Conditionally echo archive pagination in a format dependent on chosen setting.
 *
 * This is shown at the end of archives to get to another page of entries.
 *
 * @since 0.2.3
 *
 * @uses genesis_get_option()            Get theme setting value.
 * @uses genesis_prev_next_posts_nav()   Prev and Next links.
 * @uses genesis_numeric_posts_nav()     Numbered links.
 */
function ygf_post_nav()
{
    if ('numeric' === genesis_get_option('posts_nav')) {
        ygf_numeric_posts_nav();
    } else {
        genesis_prev_next_posts_nav();
    }
}
Esempio n. 16
0
function single_post_featured_image()
{
    if (!is_singular()) {
        return;
    }
    $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'attr' => array('class' => 'post-image')));
    printf('<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img);
}
Esempio n. 17
0
function generate_post_image()
{
    if (is_page() || !genesis_get_option('content_archive_thumbnail')) {
        return;
    }
    if ($image = genesis_get_image(array('format' => 'url', 'size' => genesis_get_option('image_size')))) {
        printf('<a href="%s" rel="bookmark"><img class="post-image" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute('echo=0'));
    }
}
function nabm_footer_creds_text($creds)
{
    $custom_creds = genesis_get_option('nabm_footer_creds');
    if ($custom_creds) {
        return $custom_creds;
    } else {
        return $creds;
    }
}
/**
 * Outputs a custom loop
 *
 * @global mixed $paged current page number if paginated
 * @return void
 */
function sk_masonry_loop()
{
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    //* Easter Egg
    $query_args = wp_parse_args(genesis_get_custom_field('query_args'), array('cat' => $include, 'category__not_in' => $exclude, 'showposts' => genesis_get_option('blog_cat_num'), 'paged' => $paged));
    genesis_custom_loop($query_args);
}
Esempio n. 20
0
function wpbilbao_featured_photo()
{
    if (is_page() || !genesis_get_option('content_archive_thumbnail')) {
        return;
    }
    if ($image = genesis_get_image(array('format' => 'url', 'size' => genesis_get_option('image_size')))) {
        printf('<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', $image, the_title_attribute('echo=0'));
    }
}
Esempio n. 21
0
/**
 * Helper function to make getting the bacon bar options less verbose.
 *
 * @param  $option the option value to check.
 * @return $output the returned option value.
 * @uses   genesis_get_option()
 * @uses   baconbar_is_customizer()
 * @since  1.0.1
 */
function baconbar_get_option($option)
{
    $use_cache = true;
    if (baconbar_is_customizer()) {
        $use_cache = false;
    }
    $output = genesis_get_option($option, 'bacon-settings', $use_cache);
    return $output;
}
Esempio n. 22
0
/**
 * Display the image
 * 
 * We know it's an image since the file is image.php
 */
function genesis_image_do_entry_content()
{
    $img = genesis_get_image(array('format' => 'html', 'size' => genesis_get_option('image_size'), 'context' => 'archive', 'attr' => genesis_parse_attr('entry-image')));
    if (!empty($img)) {
        echo $img;
    } else {
        //echo "Not got it yet";
    }
}
Esempio n. 23
0
/**
 * Use WordPress archive pagination.
 *
 * Return a paginated navigation to next/previous set of posts, when
 * applicable. Includes screen reader text for better accessibility.
 *
 * @since  1.0.0
 *
 * @see  the_posts_pagination()
 * @return string Markup for pagination links.
 */
function utility_pro_post_pagination()
{
    $args = array('mid_size' => 2, 'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'utility-pro') . ' </span>');
    if ('numeric' === genesis_get_option('posts_nav')) {
        the_posts_pagination($args);
    } else {
        the_posts_navigation($args);
    }
}
Esempio n. 24
0
function gs_css_loader()
{
    $switch = genesis_get_option('gs_switch', 'gs-settings');
    // if it isn't turned on, don't add it
    if ($switch !== 'true') {
        return;
    }
    // otherwise load our CSS
    wp_enqueue_style('gs-style', plugins_url('/css/gs-custom.css', __FILE__));
}
Esempio n. 25
0
 /**
  * Customize the footer credits text
  *
  * @since    1.0.0
  * @var      string    $creds      	Footer credits text from customizer.
  */
 public function footer_options_credits_text($creds)
 {
     $settings_field = GSC_Base::$default_settings_field;
     $custom_credits = genesis_get_option('footer_credits_text', $settings_field);
     if ($custom_credits) {
         return $custom_credits;
     } else {
         return $creds;
     }
 }
function portfolio_loop()
{
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $include = genesis_get_option('crystal_portfolio_cat');
    $exclude = genesis_get_option('crystal_portfolio_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('crystal_portfolio_cat_exclude'))) : '';
    $cf = genesis_get_custom_field('query_args');
    // Easter Egg
    $args = array('cat' => $include, 'category__not_in' => $exclude, 'showposts' => genesis_get_option('crystal_portfolio_cat_num'), 'paged' => $paged);
    $query_args = wp_parse_args($cf, $args);
    genesis_custom_loop($query_args);
}
/**
 * This function loads front-end JS files
 *
 */
function genesis_load_scripts()
{
    if (is_singular() && get_option('thread_comments') && comments_open()) {
        wp_enqueue_script('comment-reply');
    }
    // Load superfish and our common JS (in the footer, and only if necessary)
    if (genesis_get_option('nav_superfish') || genesis_get_option('subnav_superfish') || is_active_widget(0, 0, 'menu-categories') || is_active_widget(0, 0, 'menu-pages') || is_active_widget(0, 0, 'custom-menu')) {
        wp_enqueue_script('superfish', GENESIS_JS_URL . '/menu/superfish.js', array('jquery'), '1.4.8', true);
        wp_enqueue_script('superfish-args', GENESIS_JS_URL . '/menu/superfish.args.js', array('superfish'), PARENT_THEME_VERSION, true);
    }
}
/**
 * Register THEMEMIXFC for use in the Genesis theme.
 *
 * @since 1.1.0
 */
function thememixfc_widgets_init()
{
    if (class_exists('Premise_Base') && !is_admin()) {
        return;
    }
    $gfwa = genesis_get_option('thememixfc_gfwa');
    if (class_exists('Genesis_Featured_Widget_Amplified') && $gfwa) {
        unregister_widget('Genesis_Featured_Widget_Amplified');
    }
    register_widget('GS_Featured_Content');
}
function child_stylesheet_uri($stylesheet, $dir)
{
    $style = genesis_get_option('style_selection');
    if (!$style) {
        return $stylesheet;
    }
    if (!file_exists(CHILD_DIR . '/' . $style)) {
        return $stylesheet;
    }
    return $dir . '/' . $style;
}
Esempio n. 30
0
/**
 * Enqueue the scripts used on the front-end of the site.
 *
 * Includes comment-reply, superfish and the superfish arguments.
 *
 * @since 0.2.0
 */
function genesis_load_scripts()
{
    /** If a single post or page, threaded comments are enabled, and comments are open */
    if (is_singular() && get_option('thread_comments') && comments_open()) {
        wp_enqueue_script('comment-reply');
    }
    /** If a superfish option is enabled or showing a menu of any type, load superfish and the arguments for it in the footer */
    if (genesis_get_option('nav_superfish') || genesis_get_option('subnav_superfish') || is_active_widget(0, 0, 'menu-categories') || is_active_widget(0, 0, 'menu-pages') || is_active_widget(0, 0, 'nav_menu')) {
        wp_enqueue_script('superfish', GENESIS_JS_URL . '/menu/superfish.js', array('jquery'), '1.4.8', true);
        wp_enqueue_script('superfish-args', GENESIS_JS_URL . '/menu/superfish.args.js', array('superfish'), PARENT_THEME_VERSION, true);
    }
}