static function get_static_content($args = array())
 {
     $default = array('id' => false, 'post_type' => 'static_block', 'class' => '', 'title' => '', 'showtitle' => false, 'titletag' => 'h3');
     $args = (object) array_merge($default, $args);
     // Find the page data
     if (!empty($args->id)) {
         // Get content by ID or slug
         $id = $args->id;
         $id = !is_numeric($id) ? get_ID_by_slug($id, $args->post_type) : $id;
         // Get the page contenet
         $page_data = get_page($id);
     } else {
         $page_data = null;
     }
     // Format and return data
     if (is_null($page_data)) {
         return '<!-- [No arguments where provided or the values did not match an existing static block] -->';
     } else {
         // The content
         $content = $page_data->post_content;
         $content = apply_filters('static_content', $content);
         // NOTE: This entire section could be setup as a filter.
         if (get_post_meta($id, 'content_filters', true) == 'all') {
             // Apply all WP content filters, including those added by plugins.
             // This can still have autop turned off with our internal filter.
             $GLOBALS['wpautop_post'] = $page_data;
             // not default $post so global variable used by wpautop_disable(), if function exists
             $content = apply_filters('the_content', $content);
         } else {
             // Only apply default WP filters. This is the safe way to add basic formatting without any plugin injected filters
             $content = wptexturize($content);
             $content = convert_smilies($content);
             $content = convert_chars($content);
             if (get_post_meta($id, 'wpautop', true) == 'on') {
                 // (!wpautop_disable($id)) {
                 $content = wpautop($content);
                 // Add paragraph tags.
             }
             $content = shortcode_unautop($content);
             $content = prepend_attachment($content);
             $content = do_shortcode($content);
         }
         $class = !empty($args->class) ? trim($args->class) : '';
         $content = '<div id="static-content-' . $id . '" class="static-content ' . $class . '">' . $content . '</div>';
         // The title
         if (!empty($args->title)) {
             $title = $args->title;
             $showtitle = true;
         } else {
             $title = $page_data->post_title;
             $showtitle = $args->showtitle;
         }
         if ($showtitle) {
             $content = '<' . $args->titletag . ' class="static-content-title page-title">' . $page_data->post_title . '</' . $args->titletag . '>' . $content;
         }
         // Return content
         return $content;
     }
 }
Exemplo n.º 2
0
function foodrush_timber_context($context)
{
    // Enable ACF options everywhere
    $context['option'] = get_fields('option');
    // Enable menu
    $context['menu'] = new TimberMenu('main_menu');
    $context['footer_menu'] = new TimberMenu('footer_menu');
    $context['current_prize'] = get_the_title(get_ID_by_slug('prize-draw'));
    $context['current_url'] = home_url() . $_SERVER['REQUEST_URI'];
    return $context;
}
			<div class="clear"></div>
		</div>
		<?php 
}
?>
		
		
		<?php 
if ($theFooter['content_bottom']) {
    ?>
		<div class="pageWrapper footerEnd">	
			<div class="inner-1">
				<div class="ugc clearfix">
					<?php 
    $id = $theFooter['content_bottom'];
    $id = !is_numeric($id) ? get_ID_by_slug($id, 'static_block') : $id;
    echo theme_get_page($id);
    ?>
				</div>				
			</div>		
			<div class="clear"></div>
		</div>
		<?php 
}
?>
	
	</div>
	
	<div id="FooterBgImage" class="footerBg" style="<?php 
the_bg_style("footer");
?>
Exemplo n.º 4
0
		<?php 
get_header();
?>
		<!-- CAROUSEL & SERVICES -->		
		<section class="silver">
			<div class="container">
			
			<h2 class="home-section-headings">Supporting adults in leading<br/> a positive, fullfilling life.</h2>	
			<div class="homepromos">
				<div class="carousel">
		            <article class="bxslider-wrapper">
		                <div>
		                    <ul class="bxslider" id="carousel">		
		                    <?php 
query_posts(array('showposts' => 10, 'post_parent' => get_ID_by_slug('homepage-slideshows'), 'post_type' => 'page'));
?>
		
		                    <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
			                    <li>
									<div class="tapbox">                    
										<?php 
        the_content();
        echo get_the_ID();
        ?>
										<?php 
        $this_page_id = get_the_ID();
        echo $this_page_id;
<?php

$real_stories = get_ID_by_slug('real-stories');
$icon_list = new page_list_with_icons();
$mobile_Icons = new page_list_with_icons_Mobile();
if (is_mobile()) {
    ?>
<div class="col-lg-12 <?php 
    if (!is_front_page()) {
        echo 'templateSliderMobile';
    }
    ?>
"><i style="position: absolute;top: 50%; margin-top:-50px;left: 14px;font-size: 81px; color:#0DBDEE; z-index:100000000" class="fa fa-caret-left"></i>
  <div id="slider" class="nav-reasons swipe">
    <div class="grid<?php 
    if (is_front_page() or is_page('abtesting')) {
        echo ' parent';
    }
    ?>
 swipe-wrap"><?php 
    $stories_nav = array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'page-story.php', 'title_li' => '', 'link_before' => '<span class="nav-reasons-title">', 'link_after' => '</span>', 'walker' => $mobile_Icons, 'depth' => 0);
    wp_list_pages($stories_nav);
    ?>
    </div>
  </div><i style="position: absolute; top: 50%; margin-top:-50px; right: 14px; font-size: 81px; color:#0DBDEE; z-index:100000000" class="fa fa-caret-right"></i>
</div><?php 
} else {
    ?>
<nav class="nav-reasons"> 
  <ul class="grid<?php 
    if (is_front_page() or is_page('abtesting')) {
Exemplo n.º 6
0
    echo $post_thumb;
    ?>
);">
	<div class="overlay"></div>
</section>
<?php 
}
?>
<section id="ministries" class="pageContent">
	<div class="constrain row">
		<div class="grid-3">
			<h1 class="entry-title">Ministries</h1>
		</div>
		<div class="grid-9">
		    <?php 
$pages = get_pages(array('sort_order' => 'DESC', 'sort_column' => 'menu_order', 'hierarchical' => 0, 'parent' => get_ID_by_slug('ministries')));
foreach ($pages as $page) {
    ?>
			
			<a href="<?php 
    echo get_page_link($page->ID);
    ?>
" class="ministry-item">
				<h3 class="ministry-title"><?php 
    echo $page->post_title;
    ?>
</h3>
				<p class="ministry-summary"><?php 
    the_field('ministry_description', $page->ID);
    ?>
</p>
Exemplo n.º 7
0
	</span>
</li>	

<?php 
        }
    }
    wp_reset_query();
    ?>
<li class="ideas-list"></li>
					</ul>
				</div>
				
				<div class="span6 home-about">
					<h5 class="widget-title">About CityHow</h5>
<?php 
    $page_id = get_ID_by_slug('about');
    $post = get_post($page_id);
    $content = $post->post_content;
    $content = strip_tags($content, '<p>,<a>');
    $content = trim_by_words($content, '98', nh_continue_reading_link());
    echo $content;
    ?>
					
				</div>
			</div>

<?php 
    // END IF USER LOGGED IN
}
?>
			
        wp_delete_post(get_ID_by_slug($object_slug . '-view'), true);
        wp_delete_post(get_ID_by_slug($object_slug . '-list'), true);
        wp_delete_post(get_ID_by_slug($object_slug . '-form'), true);
        ui_delete_viev_and_hierarhy_files($object_slug, 'user');
        ui_remove_users_declarations($object_slug);
        ui_remove_template_file($object_slug, 'user');
    }
    /* ---------------------------------------------------------------------- */
    /* Swith to add DATABASE                                                  */
    /* ---------------------------------------------------------------------- */
    if ($_POST['objecttype'] == 'db') {
        //echo 'delete'.$object_slug . '-view';
        //echo get_ID_by_slug( $object_slug . '-view' );
        wp_delete_post(get_ID_by_slug($object_slug . '-view'), true);
        wp_delete_post(get_ID_by_slug($object_slug . '-list'), true);
        wp_delete_post(get_ID_by_slug($object_slug . '-form'), true);
        ui_delete_viev_and_hierarhy_files($object_slug, 'db');
        ui_remove_db_declarations($object_slug);
        ui_remove_template_file($object_slug, 'db');
    }
} else {
    ?>
	<pre class="alert alert-danger" style="font-size:24px; margin:20px; font-family:arial">You dont have access to create this object. <br/>You must login as admin to do it.</pre>
<?php 
}
function ui_delete_viev_and_hierarhy_files($object_name, $objecttype)
{
    $plugin_dir = GLOBALDATA_PATH . 'template-hierarchy/arguments/';
    $file = $object_name . '-view-slots-hierarchy.yaml';
    unlink($plugin_dir . $file);
    $plugin_dir = AGLOBALDATA_PATH . 'template-hierarchy/arguments/';
Exemplo n.º 9
0
    ?>
 
  
</ul> 

<div class="sep"></div>

<?php 
}
?>



<?php 
if (get_ID_by_slug(get_option('of_homepage_content'))) {
    $maincontent = get_ID_by_slug(get_option('of_homepage_content'));
    $maincontent = "showposts=1&page_id={$maincontent}";
    query_posts($maincontent);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $more = 0;
            ?>
                <?php 
            the_content("<span>Read More</span>", false);
        }
    }
} else {
    get_template_part('homepage-default');
}
?>
 function show_header_content($id)
 {
     global $post;
     if (!$id) {
         // that's not good, we need an id to use
     } else {
         $content = explode(",", $id);
         switch ($content[0]) {
             case 'ss':
                 // slide show
                 display_slideShow($content[1]);
                 break;
             case 'static':
                 // static content
                 $id = $content[1];
                 $id = !is_numeric($id) ? get_ID_by_slug($id, 'static_block') : $id;
                 echo theme_get_page($id);
                 //display_headerGraphic($content[1]);
                 break;
             default:
                 // this shouldn't happen.
         }
     }
     return true;
 }
function the_breadcrumb()
{
    global $post;
    echo '<div class="silver breadcrumbs">';
    echo '<nav class="container">';
    echo '<ul>';
    if (!is_home()) {
        echo '<li><a href="';
        echo get_option('home');
        echo '">';
        echo '<i class="fa fa-home"></i>';
        echo '</a></li><li> / </li>';
        if (is_archive() && !tribe_is_event_category()) {
            echo '<li><a href="' . get_permalink(get_ID_by_slug('whats-new')) . '">' . get_the_title(get_ID_by_slug('whats-new')) . '</a><li/><li>';
            echo '</li><li> / </li><li><strong>' . return_child_cat('whats-new') . ' </strong>';
            //echo 'archive';
        } elseif (is_single() && !tribe_is_event_category()) {
            echo '<li><a href="' . get_permalink(get_ID_by_slug('whats-new')) . '">' . get_the_title(get_ID_by_slug('whats-new')) . '</a><li/><li>';
            echo '</li><li> / </li><li>';
            echo '<li>' . return_child_cat('whats-new', TRUE);
            echo '</li><li> / </li><li>';
            the_title();
            echo '</li>';
            //echo 'single';
        } elseif (is_page()) {
            //echo 'page';
            if ($post->post_parent) {
                $anc = get_post_ancestors($post->ID);
                $title = get_the_title();
                foreach ($anc as $ancestor) {
                    $output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> <li>/</li>';
                }
                echo $output;
                echo '<strong title="' . $title . '"> ' . $title . '</strong>';
            } else {
                echo '<li><strong> ' . get_the_title() . '</strong></li>';
            }
        } elseif (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular('tribe_events')) {
            echo '<li><strong>Going out</strong></li>';
            echo '<li> / </li>';
            if (tribe_is_event_category()) {
                echo '<li><strong>' . tribe_get_event_taxonomy() . '</strong></li>';
            }
            if (is_singular('tribe_events')) {
                echo '<li> / </li>';
                echo '<li><strong>' . get_the_title() . '</strong></li>';
            }
        } elseif (is_search()) {
            echo '<li>Search Results: ' . the_search_query() . '</li>';
        }
    } elseif (is_tag()) {
        single_tag_title();
    } elseif (is_day()) {
        echo "<li>Archive for ";
        the_time('F jS, Y');
        echo '</li>';
    } elseif (is_month()) {
        echo "<li>Archive for ";
        the_time('F, Y');
        echo '</li>';
    } elseif (is_year()) {
        echo "<li>Archive for ";
        the_time('Y');
        echo '</li>';
    } elseif (is_author()) {
        echo "<li>Author Archive";
        echo '</li>';
    } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
        echo "<li>Blog Archives";
        echo '</li>';
    }
    echo '</ul>';
    echo '</nav>';
    echo '</div>';
}
Exemplo n.º 12
0
 function get_layout_content_block($type = false, $source = false)
 {
     if (!$type || $type == 'default_content') {
         return '';
     } else {
         // no problems so far, start outputting the content
         switch ($type) {
             case "sidebar":
                 echo '<div class="widget-area">';
                 if (!function_exists('dynamic_sidebar') || !dynamic_sidebar($source)) {
                 }
                 echo '</div> <!-- / .widget-area -->';
                 break;
             case "static_block":
                 if (class_exists('StaticBlockContent')) {
                     $id = $source;
                     $args["id"] = !is_numeric($id) ? get_ID_by_slug($id, 'static_block') : $id;
                     $args["id"] = $id;
                     return StaticBlockContent::get_static_content($args);
                 }
                 break;
             case "page":
                 $id = $source;
                 $id = !is_numeric($id) ? get_ID_by_slug($id, 'page') : $id;
                 return get_content_for_layout($id);
                 break;
             case "post":
                 $id = $source;
                 $id = !is_numeric($id) ? get_ID_by_slug($id, 'post') : $id;
                 // not sure this works with posts
                 return get_content_for_layout($id);
                 break;
             default:
                 // if no other option fits...
                 return '<!-- [Unknown Type: ' . $type . ', Source: ' . $source . '] -->';
         }
     }
 }