예제 #1
0
function fpo_component_end()
{
    if (!nebula_is_option_enabled('wireframing')) {
        return false;
    }
    echo '</div><!-- /fpo -->';
}
예제 #2
0
    function widget($args, $instance)
    {
        //WP_Widget::widget - do not rename this
        extract($args);
        ?>


			<?php 
        if (is_single() && nebula_is_option_enabled('authorbios')) {
            ?>
				<?php 
            echo $before_widget;
            ?>

				<?php 
            echo $before_title . '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author_meta('display_name') . $after_title;
            ?>
				<?php 
            if (get_the_author_meta('headshot_url')) {
                ?>
					<a href="<?php 
                echo get_author_posts_url(get_the_author_meta('ID'));
                ?>
"><img class="nebula-author-bio-thumbnail" src="<?php 
                echo esc_attr(get_the_author_meta('headshot_url', $user->ID));
                ?>
" /></a>
				<?php 
            }
            ?>
				<p>This widget is in development.</p>
				<?php 
            //Get/echo author name (and link to author archive)
            //Get author bio
            ?>

				<?php 
            echo $after_widget;
            ?>
			<?php 
        }
        ?>


			<?php 
    }
예제 #3
0
<?php

if (nebula_is_option_enabled('comments')) {
    ?>
	<div id="nebulacommentswrapper">
		<?php 
    if (get_option('nebula_disqus_shortname')) {
        ?>
			<div id="disqus_thread"></div>
			<script type="text/javascript">
				<?php 
        //Note this is a manual implementation of Disqus; we are NOT using the WordPress plugin for implementation.
        ?>
				var disqus_shortname = '<?php 
        echo get_option('nebula_disqus_shortname', '');
        ?>
';
				var disqus_identifier = '<?php 
        echo 'the-id-' . get_the_id();
        ?>
';
				var disqus_title = '<?php 
        the_title();
        ?>
';
				var disqus_url = '<?php 
        the_permalink();
        ?>
';

				(function(){
예제 #4
0
function nebula_advanced_search()
{
    if (!wp_verify_nonce($_POST['nonce'], 'nebula_ajax_nonce')) {
        die('Permission Denied.');
    }
    ini_set('memory_limit', '512M');
    //Increase memory limit for this script.
    $everything_query = get_transient('nebula_everything_query');
    if (empty($venue_query)) {
        $everything_query = new WP_Query(array('post_type' => array('any'), 'post_status' => 'publish', 'posts_per_page' => -1, 'nopaging' => true));
        set_transient('nebula_everything_query', $everything_query, 60 * 60);
        //1 hour cache
    }
    $posts = $everything_query->get_posts();
    foreach ($posts as $post) {
        $author = null;
        if (nebula_is_option_enabled('authorbios')) {
            //&& $post->post_type != 'page' ?
            $author = array('id' => $post->post_author, 'name' => array('first' => get_the_author_meta('first_name', $post->post_author), 'last' => get_the_author_meta('last_name', $post->post_author), 'display' => get_the_author_meta('display_name', $post->post_author)), 'url' => get_author_posts_url($post->post_author));
        }
        $these_categories = array();
        $event_categories = get_the_category($post->ID);
        foreach ($event_categories as $event_category) {
            $these_categories[] = $event_category->name;
        }
        $these_tags = array();
        $event_tags = wp_get_post_tags($post->ID);
        foreach ($event_tags as $event_tag) {
            $these_tags[] = $event_tag->name;
        }
        $custom_fields = array();
        foreach ($post->custom_fields as $custom_field => $custom_value) {
            if (substr($custom_field, 0, 1) == '_') {
                continue;
            }
            $custom_fields[$custom_field] = $custom_value[0];
        }
        $full_size = wp_get_attachment_image_src($post->_thumbnail_id, 'full');
        $thumbnail = wp_get_attachment_image_src($post->_thumbnail_id, 'thumbnail');
        $output[] = array('type' => $post->post_type, 'id' => $post->ID, 'posted' => strtotime($post->post_date), 'modified' => strtotime($post->post_modified), 'author' => $author, 'title' => $post->post_title, 'description' => strip_tags($post->post_content), 'url' => get_the_permalink($post->ID), 'categories' => $these_categories, 'tags' => $these_tags, 'image' => array('full' => $thumbnail[0], 'thumbnail' => $full_size[0]), 'custom' => $custom_fields);
    }
    //END $posts foreach
    //@TODO: if going to sort by text:
    /*
    	usort($output, function($a, $b){
    		return strcmp($a['title'], $b['title']);
    	});
    */
    //@TODO: If going to sort by number:
    /*
    	usort($output, function($a, $b){
    		return $a['posted'] - $b['posted'];
    	});
    */
    echo json_encode($output, JSON_PRETTY_PRINT);
    exit;
}
예제 #5
0
     echo 'clientinfo.businessopen = false;';
 }
 if (nebula_option('nebula_cd_businesshours')) {
     echo 'ga("set", gaCustomDimensions["businessHours"], "' . $business_open . '");';
 }
 //Relative time ("Late Morning", "Early Evening")
 if (nebula_option('nebula_cd_relativetime')) {
     $relative_time = nebula_relative_time();
     $time_description = implode(' ', $relative_time['description']);
     $time_range = $relative_time['standard'][0] . ':00' . $relative_time['ampm'] . ' - ' . $relative_time['standard'][2] . ':59' . $relative_time['ampm'];
     echo 'ga("set", gaCustomDimensions["relativeTime"], "' . ucwords($time_description) . ' (' . $time_range . ')");';
 }
 //Session ID
 if (nebula_option('nebula_cd_sessionid')) {
     $session_info = is_debug() ? 'Dbg.' : '';
     $session_info .= nebula_is_option_enabled('wireframing') ? 'Wr.' : '';
     if (is_client()) {
         $session_info .= 'Cl.';
     } elseif (is_dev()) {
         $session_info .= 'Dv.';
     }
     $session_info .= is_user_logged_in() ? 'Li.' : '';
     $session_info .= nebula_is_bot() ? 'Bt.' : '';
     echo 'clientinfo.sessionid = new Date().getTime() + ".' . $session_info . '" + Math.random().toString(36).substring(5);';
     echo 'ga("set", gaCustomDimensions["sessionID"], clientinfo.sessionid);';
 }
 //WordPress User ID
 $current_user = wp_get_current_user();
 if ($current_user && nebula_option('nebula_cd_userid')) {
     echo 'ga("set", gaCustomDimensions["userID"], "' . $current_user->ID . '");';
 }
예제 #6
0
<?php

/**
 * The template for displaying Author Archive pages.
 */
if (!defined('ABSPATH')) {
    //Redirect (for logging) if accessed directly
    header('Location: http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], "wp-content/")) . '?ndaat=' . basename($_SERVER['PHP_SELF']));
    die('Error 403: Forbidden.');
}
if (!nebula_is_option_enabled('authorbios')) {
    header('Location: ' . home_url('/') . '?s=about');
    die('Error 403: Forbidden.');
}
do_action('nebula_preheaders');
get_header();
?>

<section id="bigheadingcon">
	<div class="container">
		<div class="row">
			<div class="sixteen columns">
				<h1 class="articles-by">Articles by <strong><?php 
echo get_the_author_meta('first_name') != '' ? get_the_author_meta('first_name') : get_the_author_meta('display_name');
?>
</strong></h1>
			</div><!--/columns-->
		</div><!--/row-->
	</div><!--/container-->
</section>
예제 #7
0
function nebula_remove_actions()
{
    //Note: Priorities much MATCH (not exceed) [default if undeclared is 10]
    if (!is_admin()) {
        //Frontend
        //remove_action('wpseo_head', 'debug_marker', 2 ); //Remove Yoast comment [not working] (not sure if second comment could be removed without modifying class-frontend.php)
        if (!nebula_is_option_enabled('adminbar')) {
            remove_action('wp_head', '_admin_bar_bump_cb');
            //Admin bar <style> bump
        }
        if (get_the_ID() == 1) {
            remove_action('wp_footer', 'cff_js', 10);
        }
        //Custom Facebook Feed - Remove the feed from the homepage. @TODO "Plugins" 2: Update to any page/post type that should NOT have the Facebook Feed
    } else {
        //WP Admin
        remove_filter('admin_footer_text', 'espresso_admin_performance');
        //Event Espresso - Prevent adding text to WP Admin footer
        remove_filter('admin_footer_text', 'espresso_admin_footer');
        //Event Espresso - Prevent adding text to WP Admin footer
        remove_meta_box('espresso_news_dashboard_widget', 'dashboard', 'normal');
        //Event Espresso - Remove Dashboard Metabox
        //remove_action('init', 'wpseo_description_test'); //Wordpress SEO (Yoast) - Remove Meta Description test (@TODO "Nebula" 0: Not Working - this function is called all over the place...)
        //remove_action('admin_init', 'after_update_notice', 15); //Wordpress SEO (Yoast) - Remove "WordPress SEO by Yoast has been updated" box (@TODO "Nebula" 0: Not Working)
        //global $WPSEO_Admin_Init; //@TODO "Nebula" 0: Test this next time the box appears after an update.
        //remove_action('admin_init', array($WPSEO_Admin_Init, 'after_update_notice'), 15); //@TODO "Nebula" 0: Test this next time the box appears after an update... didnt work
    }
}
예제 #8
0
function admin_favicon()
{
    $cache_buster = is_debug() ? '?r' . mt_rand(1000, 99999) : '';
    echo '<link rel="shortcut icon" href="' . get_template_directory_uri() . '/images/meta/favicon.ico' . $cache_buster . '" />';
}
//Add classes to the admin body
add_filter('admin_body_class', 'nebula_admin_body_classes');
function nebula_admin_body_classes($classes)
{
    global $current_user;
    $user_roles = $current_user->roles;
    $classes .= array_shift($user_roles);
    return $classes;
}
//Disable Admin Bar (and WP Update Notifications) for everyone but administrators (or specific users)
if (!nebula_is_option_enabled('adminbar')) {
    add_action('wp_print_scripts', 'dequeue_admin_bar', 9999);
    add_action('wp_print_styles', 'dequeue_admin_bar', 9999);
    function dequeue_admin_bar()
    {
        wp_deregister_style('admin-bar');
        wp_dequeue_script('admin-bar');
    }
    add_action('init', 'admin_only_features');
    function admin_only_features()
    {
        remove_action('wp_footer', 'wp_admin_bar_render', 1000);
        //For the front-end
        //CSS override for the frontend
        add_filter('wp_head', 'remove_admin_bar_style_frontend', 99);
        function remove_admin_bar_style_frontend()