Example #1
0
function suffusion_print_line_byline($position)
{
    global $post, $suf_page_meta_position;
    if (!is_singular() && $post->post_type != 'page' || is_singular() && !is_page()) {
        $original_format = suffusion_get_post_format();
        if ($original_format == 'standard') {
            $format = '';
        } else {
            $format = $original_format . '_';
        }
        $meta_position = 'suf_post_' . $format . 'meta_position';
        global ${$meta_position};
        $post_meta_position = apply_filters('suffusion_byline_position', ${$meta_position});
        if ($post_meta_position == $position) {
            get_template_part('custom/byline-line', $original_format);
        }
    }
    if ($suf_page_meta_position == $position && (is_page() || !is_singular() && $post->post_type == 'page')) {
        get_template_part('custom/byline-line-page', suffusion_get_page_template());
    }
}
Example #2
0
<?php

/**
 * Shows the title of the post along with the meta information. This file should not be loaded by itself, but should instead be included using get_template_part or locate_template.
 * Users can override this in a child theme. If you want a different style of title and meta for a different custom post type, you can create a file
 * called post-header-<post-type>.php. E.g. post-header-book.php. If you want a different structure for posts / pages, you could use post-header-post.php and/or
 * post-header-page.php.
 *
 * @since 3.8.3
 * @package Suffusion
 * @subpackage Custom
 */
global $post, $suf_page_show_comment, $suf_page_show_posted_by, $suf_page_meta_position;
$format = suffusion_get_post_format();
if ($format == 'standard') {
    $format = '';
} else {
    $format = $format . '_';
}
$meta_position = 'suf_post_' . $format . 'meta_position';
$show_cats = 'suf_post_' . $format . 'show_cats';
$show_posted_by = 'suf_post_' . $format . 'show_posted_by';
$show_tags = 'suf_post_' . $format . 'show_tags';
$show_comment = 'suf_post_' . $format . 'show_comment';
$show_perm = 'suf_post_' . $format . 'show_perm';
$with_title_show_perm = 'suf_post_' . $format . 'with_title_show_perm';
global ${$meta_position}, ${$show_cats}, ${$show_posted_by}, ${$show_tags}, ${$show_comment}, ${$show_perm}, ${$with_title_show_perm};
$post_meta_position = ${$meta_position};
$post_show_cats = ${$show_cats};
$post_show_posted_by = ${$show_posted_by};
$post_show_tags = ${$show_tags};
Example #3
0
/**
 * Adds a few more classes to the post_class response:
 * 	- category id
 * 	- post sequence #
 * 	- post parity
 * 	- excerpt / full-content
 * 	- no-title if title is not shown
 *  - fix
 *
 * @param $classes
 * @return array
 */
function suffusion_extra_post_classes($classes)
{
    global $post;
    global $bbp;
    // Check for bbPress < 2.1
    if (!isset($bbp) && function_exists('bbpress')) {
        $bbp = bbpress();
    }
    // If this is a bbPress post type, bail. Otherwise the display of bbPress tables will get hammered.
    if (isset($bbp) && (isset($bbp->forum_post_type) && $post->post_type == $bbp->forum_post_type || isset($bbp->topic_post_type) && $post->post_type == $bbp->topic_post_type || isset($bbp->reply_post_type) && $post->post_type == $bbp->reply_post_type)) {
        return $classes;
    }
    static $suffusion_post_sequence;
    global $suffusion_cpt_post_id;
    $categories = get_the_category();
    if (is_array($categories)) {
        foreach ($categories as $category) {
            $classes[] = 'category-' . $category->cat_ID . '-id';
        }
    }
    if (!is_single() && !is_page()) {
        $suffusion_post_sequence++;
        $classes[] = 'post-seq-' . $suffusion_post_sequence;
        if ($suffusion_post_sequence % 2 == 1) {
            $classes[] = 'post-parity-odd';
        } else {
            $classes[] = 'post-parity-even';
        }
    } else {
        if (is_single()) {
            $classes[] = 'full-content';
        }
    }
    if (is_single() || !is_page() && !is_single()) {
        $title = get_the_title();
        $format = suffusion_get_post_format();
        $format = $format == 'standard' ? '' : $format . '_';
        $show_title = 'suf_post_' . $format . 'show_title';
        $byline_position = 'suf_post_' . $format . 'meta_position';
        global ${$show_title}, ${$byline_position};
        if (isset(${$show_title})) {
            $show_title = ${$show_title};
        }
        if ($title == '' || isset($show_title) && $show_title == 'hide') {
            $classes[] = 'no-title';
        }
        if (!isset($suffusion_cpt_post_id)) {
            $classes[] = 'meta-position-' . ${$byline_position};
        }
    }
    if (is_page()) {
        global $suf_page_meta_position;
        $classes[] = 'meta-position-' . $suf_page_meta_position;
    }
    global $post, $suffusion_cpt_layouts, $suffusion_is_cpt;
    if ($post->post_type != 'post' && $post->post_type != 'page') {
        // Custom post type. See if there is style inheritance
        $cpt_classes = array();
        $suffusion_post_types = get_option('suffusion_post_types');
        if (is_array($suffusion_post_types)) {
            foreach ($suffusion_post_types as $suffusion_post_type) {
                if ($post->post_type == $suffusion_post_type['post_type']) {
                    if ($suffusion_post_type['style_inherit'] != 'custom') {
                        $cpt_classes[] = $suffusion_post_type['style_inherit'];
                    }
                    break;
                }
            }
        }
        if (isset($suffusion_cpt_post_id)) {
            if (in_array('full-content', $classes)) {
                $full_post_classes = suffusion_get_post_meta($suffusion_cpt_post_id, 'suf_cpt_full_post_classes', true);
                if (trim($full_post_classes) != '') {
                    $full_post_classes = array_map('trim', explode(',', $full_post_classes));
                    $cpt_classes = array_merge($cpt_classes, $full_post_classes);
                }
            } else {
                $excerpt_classes = suffusion_get_post_meta($suffusion_cpt_post_id, 'suf_cpt_excerpt_classes', true);
                if (trim($excerpt_classes) != '') {
                    $excerpt_classes = array_map('trim', explode(',', $excerpt_classes));
                    $cpt_classes = array_merge($cpt_classes, $excerpt_classes);
                }
            }
        }
        if (isset($suffusion_cpt_layouts[$post->post_type]) && isset($suffusion_cpt_layouts[$post->post_type]['styles']) && trim($suffusion_cpt_layouts[$post->post_type]['styles'])) {
            $single_classes = array_map('trim', explode(',', $suffusion_cpt_layouts[$post->post_type]['styles']));
            $cpt_classes = array_merge($cpt_classes, $single_classes);
        }
        if (count($cpt_classes) == 0) {
            $cpt_classes[] = 'post';
        }
        if (is_single() && isset($suffusion_cpt_layouts[$post->post_type]) && isset($suffusion_cpt_layouts[$post->post_type]['byline'])) {
            $cpt_classes[] = 'meta-position-' . $suffusion_cpt_layouts[$post->post_type]['byline'];
        }
        $classes = array_merge($classes, $cpt_classes);
    }
    if (is_attachment()) {
        $classes[] = 'post';
    }
    $classes[] = 'fix';
    return $classes;
}