Example #1
0
			<h2 class="loop__header">Latests songs</h2>
			<ul class="small-block-grid-2">
			<?php 
    while ($songs->have_posts()) {
        $songs->the_post();
        include 'parts/loop.php';
    }
} else {
    // no posts found
}
/* Restore original Post Data */
wp_reset_postdata();
?>
		</ul>
		<a href="<?php 
echo get_site_URL();
?>
/songs">See all songs</a>
		</div>

	</div>
</div>
<div class="row bg-color">
	<div class="small-12 large-12 columns">

	<?php 
get_template_part('parts/nyhetsflode');
?>
<!-- 	<?php 
//get_sidebar();
?>
Example #2
0
function dig_for_URL_known_parent($page_id, $parent_id, $url, &$pages, $parent_id_field = 'parent_id', $orig_id = '')
{
    static $cache = array();
    if (empty($orig_id)) {
        $orig_id = $page_id;
    }
    //echo 'id: '.$page_id.'; p_id: '.$parent_id.'; url: '.$url.'<br />';
    if (isset($cache[$orig_id])) {
        return $cache[$orig_id];
    }
    if (!isset($pages[$parent_id])) {
        return false;
    }
    $parent =& $pages[$parent_id];
    if (!empty($parent)) {
        if ($parent_id == $page_id) {
            $site_url = get_site_URL($page_id);
            if (!empty($site_url)) {
                $url = get_site_URL($page_id) . $url;
            } else {
                $url = NULL;
            }
            $cache[$orig_id] = $url;
            return $url;
        } else {
            if ($parent->get_value('url_fragment')) {
                $url = $parent->get_value('url_fragment') . '/' . $url;
            }
            return dig_for_URL_known_parent($parent_id, $parent->get_value($parent_id_field), $url, $pages, $parent_id_field, $orig_id);
        }
    }
}