/**
 * Creates a meta box that allows users to customize their scripts.
 */
function omega_meta_box_theme_display_scripts()
{
    ?>
	<p>
		<label for="<?php 
    echo omega_settings_field_id('header_scripts');
    ?>
"><?php 
    printf(__('Insert scripts or code before the closing %s tag in the document source', 'omega'), '<code>&lt;/head&gt;</code>');
    ?>
:</label>
	</p>
	
	<textarea name="<?php 
    echo omega_settings_field_name('header_scripts');
    ?>
" id="<?php 
    echo omega_settings_field_id('header_scripts');
    ?>
" cols="78" rows="8"><?php 
    echo omega_get_setting('header_scripts');
    ?>
</textarea>


	<p>
		<label for="<?php 
    echo omega_settings_field_id('footer_scripts');
    ?>
"><?php 
    printf(__('Insert scripts or code before the closing %s tag in the document source', 'omega'), '<code>&lt;/body&gt;</code>');
    ?>
:</label>
	</p>

	<textarea name="<?php 
    echo omega_settings_field_name('footer_scripts');
    ?>
" id="<?php 
    echo omega_settings_field_id('footer_scripts');
    ?>
" cols="78" rows="8"><?php 
    echo omega_get_setting('footer_scripts');
    ?>
</textarea>


<?php 
}
Beispiel #2
0
/**
 * Echo the footer scripts, defined in Theme Settings.
 */
function omega_footer_scripts()
{
    echo omega_get_setting('footer_scripts');
}
Beispiel #3
0
/**
 * Produces the link to the current post comments.
 *
 * Supported shortcode attributes are:
 *   after (output after link, default is empty string),
 *   before (output before link, default is empty string),
 *   hide_if_off (hide link if comments are off, default is 'enabled' (true)),
 *   more (text when there is more than 1 comment, use % character as placeholder
 *     for actual number, default is '% Comments')
 *   one (text when there is exactly one comment, default is '1 Comment'),
 *   zero (text when there are no comments, default is 'Leave a Comment').
 *
 * Output passes through 'omega_post_comments_shortcode' filter before returning.
 *
 * @since 0.9.0
 *
 * @param array|string $atts Shortcode attributes. Empty string if no attributes.
 * @return string Shortcode output
 */
function omega_post_comments_shortcode($atts)
{
    $defaults = array('after' => '', 'before' => '', 'hide_if_off' => 'enabled', 'more' => __('% Comments', 'omega'), 'one' => __('1 Comment', 'omega'), 'zero' => __('Leave a Comment', 'omega'));
    $atts = shortcode_atts($defaults, $atts, 'post_comments');
    if ((!omega_get_setting('comments_posts') || !comments_open()) && 'enabled' === $atts['hide_if_off']) {
        return;
    }
    // Darn you, WordPress!
    ob_start();
    comments_number($atts['zero'], $atts['one'], $atts['more']);
    $comments = ob_get_clean();
    $comments = sprintf('<a href="%s">%s</a>', get_comments_link(), $comments);
    $output = '<span class="entry-comments-link">' . $atts['before'] . $comments . $atts['after'] . '</span>';
    return apply_filters('omega_post_comments_shortcode', $output, $atts);
}
/**
 * Callback for Theme Settings Comments meta box.
 */
function omega_meta_box_theme_display_comments()
{
    ?>
	<p>
		<?php 
    _e('Enable Comments', 'omega');
    ?>
		<label for="<?php 
    echo omega_settings_field_id('comments_posts');
    ?>
" title="Enable comments on posts"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('comments_posts');
    ?>
" id="<?php 
    echo omega_settings_field_id('comments_posts');
    ?>
" value="1"<?php 
    checked(omega_get_setting('comments_posts'));
    ?>
 />
		<?php 
    _e('on posts?', 'omega');
    ?>
</label>

		<label for="<?php 
    echo omega_settings_field_id('comments_pages');
    ?>
" title="Enable comments on pages"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('comments_pages');
    ?>
" id="<?php 
    echo omega_settings_field_id('comments_pages');
    ?>
" value="1"<?php 
    checked(omega_get_setting('comments_pages'));
    ?>
 />
		<?php 
    _e('on pages?', 'omega');
    ?>
</label>
	</p>

	<p>
		<?php 
    _e('Enable Trackbacks', 'omega');
    ?>
		<label for="<?php 
    echo omega_settings_field_id('trackbacks_posts');
    ?>
" title="Enable trackbacks on posts"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('trackbacks_posts');
    ?>
" id="<?php 
    echo omega_settings_field_id('trackbacks_posts');
    ?>
" value="1"<?php 
    checked(omega_get_setting('trackbacks_posts'));
    ?>
 />
		<?php 
    _e('on posts?', 'omega');
    ?>
</label>

		<label for="<?php 
    echo omega_settings_field_id('trackbacks_pages');
    ?>
" title="Enable trackbacks on pages"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('trackbacks_pages');
    ?>
" id="<?php 
    echo omega_settings_field_id('trackbacks_pages');
    ?>
" value="1"<?php 
    checked(omega_get_setting('trackbacks_pages'));
    ?>
 />
		<?php 
    _e('on pages?', 'omega');
    ?>
</label>
	</p>

	<p><span class="description"><?php 
    _e('Comments and Trackbacks can also be disabled on a per post/page basis when creating/editing posts/pages.', 'omega');
    ?>
</span></p>

<?php 
}
Beispiel #5
0
<div class="entry-meta">
	<?php 
if (is_multi_author()) {
    echo omega_apply_atomic_shortcode('entry_author', __('Posted by [post_author_posts_link] ', 'omega'));
} else {
    echo omega_apply_atomic_shortcode('entry_author', __('Posted ', 'omega'));
}
?>
	<?php 
if (omega_get_setting('trackbacks_posts') || omega_get_setting('comments_posts')) {
    echo omega_apply_atomic_shortcode('entry_byline', __('on [post_date] [post_comments] [post_edit before=" | "]', 'omega'));
} else {
    echo omega_apply_atomic_shortcode('entry_byline', __('on [post_date]  [post_edit before=" | "]', 'omega'));
}
?>
</div><!-- .entry-meta -->
/**
 * @since 0.9.0
 * @deprecated 0.9.0
 */
function hybrid_get_setting($option = '')
{
    _deprecated_function(__FUNCTION__, '0.9.0', 'omega_get_setting()');
    omega_get_setting($option);
}
Beispiel #7
0
        $output = sprintf('<p>%s %s</p>', $content, $link);
    } else {
        $output = sprintf('<p>%s</p>', $content);
        $link = '';
    }
    return apply_filters('get_the_content_limit', $output, $content, $link, $max_characters);
}
/**
 * Echo the limited content.
 *
 * @since 0.1.0
 *
 * @uses get_the_content_limit() Return content stripped down and limited content.
 *
 * @param integer $max_characters The maximum number of characters to return.
 * @param string  $more_link_text Optional. Text of the more link. Default is "(more...)".
 * @param bool    $stripteaser    Optional. Strip teaser content before the more text. Default is false.
 */
function the_content_limit($max_characters, $more_link_text = '(more...)', $stripteaser = false)
{
    $content = get_the_content_limit($max_characters, $more_link_text, $stripteaser);
    echo apply_filters('the_content_limit', $content);
}
if (omega_get_setting('more_link_scroll')) {
    add_filter('the_content_more_link', 'omega_remove_more_link_scroll');
}
function omega_remove_more_link_scroll($link)
{
    $link = preg_replace('|#more-[0-9]+|', '', $link);
    return $link;
}
/**
 * Callback for Theme Settings Post Archives meta box.
 */
function omega_meta_box_theme_display_archives()
{
    ?>
	<p>
		<label for="<?php 
    echo omega_settings_field_id('content_archive');
    ?>
"><?php 
    _e('Select one of the following:', 'omega');
    ?>
</label>
		<select name="<?php 
    echo omega_settings_field_name('content_archive');
    ?>
" id="<?php 
    echo omega_settings_field_id('content_archive');
    ?>
">
		<?php 
    $archive_display = apply_filters('omega_archive_display_options', array('full' => __('Display full post', 'omega'), 'excerpts' => __('Display post excerpts', 'omega')));
    foreach ((array) $archive_display as $value => $name) {
        echo '<option value="' . esc_attr($value) . '"' . selected(omega_get_setting('content_archive'), esc_attr($value), false) . '>' . esc_html($name) . '</option>' . "\n";
    }
    ?>
		</select>
	</p>

	<div id="omega_more_link_scroll" <?php 
    if ('full' != omega_get_setting('content_archive')) {
        echo 'class="hidden"';
    }
    ?>
>
	<p>
		<label for="<?php 
    echo omega_settings_field_id('more_link_scroll');
    ?>
"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('more_link_scroll');
    ?>
" id="<?php 
    echo omega_settings_field_id('more_link_scroll');
    ?>
" value="1" <?php 
    checked(omega_get_setting('more_link_scroll'));
    ?>
 />
		<?php 
    _e('Prevent page scroll when clicking the More Link', 'omega');
    ?>
</label>
	</p>
	</div>

	<div id="omega_content_limit_setting" <?php 
    if ('full' == omega_get_setting('content_archive')) {
        echo 'class="hidden"';
    }
    ?>
>
		<p>
			<label for="<?php 
    echo omega_settings_field_id('content_archive_limit');
    ?>
"><?php 
    _e('Limit content to', 'omega');
    ?>
			<input type="text" name="<?php 
    echo omega_settings_field_name('content_archive_limit');
    ?>
" id="<?php 
    echo omega_settings_field_id('content_archive_limit');
    ?>
" value="<?php 
    echo esc_attr(omega_get_setting('content_archive_limit'));
    ?>
" size="3" />
			<?php 
    _e('characters', 'omega');
    ?>
</label>
		</p>

		<p><span class="description"><?php 
    _e('Select "Display post excerpts" will limit the text and strip all formatting from the text displayed. Set 0 characters will display the first 55 words (default)', 'omega');
    ?>
</span></p>
	</div>

	<p>
		<?php 
    _e('More Text (if applicable):', 'omega');
    ?>
 <input type="text" name="<?php 
    echo omega_settings_field_name('content_archive_more');
    ?>
" id="<?php 
    echo omega_settings_field_id('content_archive_more');
    ?>
" value="<?php 
    echo esc_attr(omega_get_setting('content_archive_more'));
    ?>
" size="25" />			
	</p>

	<p class="collapsed">
		<label for="<?php 
    echo omega_settings_field_id('content_archive_thumbnail');
    ?>
"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('content_archive_thumbnail');
    ?>
" id="<?php 
    echo omega_settings_field_id('content_archive_thumbnail');
    ?>
" value="1" <?php 
    checked(omega_get_setting('content_archive_thumbnail'));
    ?>
 />
		<?php 
    _e('Include the Featured Image?', 'omega');
    ?>
</label>
	</p>

	<p id="omega_image_size" <?php 
    if (!omega_get_setting('content_archive_thumbnail')) {
        echo 'class="hidden"';
    }
    ?>
>
		<label for="<?php 
    echo omega_settings_field_id('image_size');
    ?>
"><?php 
    _e('Image Size:', 'omega');
    ?>
</label>
		<select name="<?php 
    echo omega_settings_field_name('image_size');
    ?>
" id="<?php 
    echo omega_settings_field_id('image_size');
    ?>
">
		<?php 
    $sizes = omega_get_image_sizes();
    foreach ((array) $sizes as $name => $size) {
        echo '<option value="' . esc_attr($name) . '"' . selected(omega_get_setting('image_size'), $name, FALSE) . '>' . esc_html($name) . ' (' . absint($size['width']) . ' &#x000D7; ' . absint($size['height']) . ')</option>' . "\n";
    }
    ?>
		</select>
	</p>
	<p>
		<label for="<?php 
    echo omega_settings_field_id('posts_nav');
    ?>
"><?php 
    _e('Select Post Navigation Format:', 'omega');
    ?>
</label>
		<select name="<?php 
    echo omega_settings_field_name('posts_nav');
    ?>
" id="<?php 
    echo omega_settings_field_id('posts_nav');
    ?>
">
			<option value="prev-next"<?php 
    selected('prev-next', omega_get_setting('posts_nav'));
    ?>
><?php 
    _e('Previous / Next', 'omega');
    ?>
</option>
			<option value="numeric"<?php 
    selected('numeric', omega_get_setting('posts_nav'));
    ?>
><?php 
    _e('Numeric', 'omega');
    ?>
</option>
		</select>
	</p>
	<p><span class="description"><?php 
    _e('These options will affect any blog listings page, including archive, author, blog, category, search, and tag pages.', 'omega');
    ?>
</span></p>	
	<p>
		<label for="<?php 
    echo omega_settings_field_id('single_nav');
    ?>
"><input type="checkbox" name="<?php 
    echo omega_settings_field_name('single_nav');
    ?>
" id="<?php 
    echo omega_settings_field_id('single_nav');
    ?>
" value="1" <?php 
    checked(omega_get_setting('single_nav'));
    ?>
 />
		<?php 
    _e('Disable single post navigation link?', 'omega');
    ?>
</label>
	</p>

<?php 
}
Beispiel #9
0
 * located in the inc/template-tags.php file.
 *
 * @package Omega
 */
/*
 * If the current post is protected by a password and
 * the visitor has not yet entered the password we will
 * return early without loading the comments.
 */
/* If a post password is required or no comments are given and comments/pings are closed, return. */
if (post_password_required() || !have_comments() && !comments_open() && !pings_open()) {
    return;
}
if (is_singular('post') && (!omega_get_setting('trackbacks_posts') && !omega_get_setting('comments_posts'))) {
    return;
} elseif (is_singular('page') && (!omega_get_setting('trackbacks_pages') && !omega_get_setting('comments_pages'))) {
    return;
}
?>

<div id="comments" class="entry-comments">

	<?php 
get_template_part('partials/comments-loop');
// Loads the comments-loop.php template.
?>

</div><!-- #comments -->

<?php 
comment_form();
    /**
     * Display navigation to next/previous pages when applicable
     */
    function omega_content_nav($nav_id)
    {
        global $wp_query, $post;
        // Don't print empty markup on single pages if there's nowhere to navigate.
        if (is_single()) {
            $previous = is_attachment() ? get_post($post->post_parent) : get_adjacent_post(false, '', true);
            $next = get_adjacent_post(false, '', false);
            if (!$next && !$previous) {
                return;
            }
        }
        // Don't print empty markup in archives if there's only one page.
        if ($wp_query->max_num_pages < 2 && (is_home() || is_archive() || is_search())) {
            return;
        }
        $nav_class = is_single() ? 'post-navigation' : 'paging-navigation';
        ?>
	<nav role="navigation" id="<?php 
        echo esc_attr($nav_id);
        ?>
" class="navigation  <?php 
        echo $nav_class;
        ?>
">

	<?php 
        if (is_single() && !omega_get_setting('single_nav')) {
            // navigation links for single posts
            ?>

		<?php 
            previous_post_link('<div class="nav-previous alignleft">%link</div>', '<span class="meta-nav">' . _x('&larr;', 'Previous post link', 'omega') . '</span> %title');
            ?>
		<?php 
            next_post_link('<div class="nav-next alignright">%link</div>', '%title <span class="meta-nav">' . _x('&rarr;', 'Next post link', 'omega') . '</span>');
            ?>

	<?php 
        } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) {
            // navigation links for home, archive, and search pages
            ?>

		<?php 
            if (current_theme_supports('loop-pagination') && 'numeric' == omega_get_setting('posts_nav')) {
                loop_pagination();
            } else {
                if (get_next_posts_link()) {
                    ?>
			<div class="nav-previous alignleft"><?php 
                    next_posts_link(__('<span class="meta-nav">&larr;</span> Previous Page', 'omega'));
                    ?>
</div>
			<?php 
                }
                ?>

			<?php 
                if (get_previous_posts_link()) {
                    ?>
			<div class="nav-next alignright"><?php 
                    previous_posts_link(__('Next Page <span class="meta-nav">&rarr;</span>', 'omega'));
                    ?>
</div>
			<?php 
                }
            }
            ?>

	<?php 
        }
        ?>

	</nav><!-- #<?php 
        echo esc_html($nav_id);
        ?>
 -->
	<?php 
    }