Archived
Merge branch 'master' of github.com:neuf/studio11-theme
This commit is contained in:
commit
9fb0e1bee8
3 files changed
+27
-10
No files matched your search
+5
-1
@@ -27,9 +27,10 @@ if($menu_id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "No frontpage menu configured";
|
echo '<a href="' . admin_url('admin.php?page=studio_lol_settings') . '">No frontpage menu configured</a>';
|
||||||
$items = array();
|
$items = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($items as $item)
|
foreach($items as $item)
|
||||||
{
|
{
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
@@ -61,8 +62,11 @@ foreach($items as $item)
|
|||||||
if($query)
|
if($query)
|
||||||
{
|
{
|
||||||
$id = strtolower(preg_replace('#[^\w]+#', '', $item->title));
|
$id = strtolower(preg_replace('#[^\w]+#', '', $item->title));
|
||||||
|
|
||||||
echo "<div class=\"content\" id=\"{$id}\">";
|
echo "<div class=\"content\" id=\"{$id}\">";
|
||||||
|
|
||||||
if($pre) echo $pre;
|
if($pre) echo $pre;
|
||||||
|
|
||||||
query_posts($query);
|
query_posts($query);
|
||||||
get_template_part( 'loop', $loop);
|
get_template_part( 'loop', $loop);
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -193,7 +193,7 @@ add_action('admin_menu', 'studio_create_menu');
|
|||||||
function studio_create_menu() {
|
function studio_create_menu() {
|
||||||
|
|
||||||
//create new top-level menu
|
//create new top-level menu
|
||||||
add_menu_page('Studio theme settings', 'Studio theme settings', 'administrator', __FILE__, 'studio_settings_page',plugins_url('/images/icon.png', __FILE__));
|
add_menu_page('Studio theme settings', 'Studio theme settings', 'administrator', 'studio_lol_settings', 'studio_settings_page',plugins_url('/images/icon.png', __FILE__));
|
||||||
|
|
||||||
//call register settings function
|
//call register settings function
|
||||||
add_action( 'admin_init', 'register_studio_settings' );
|
add_action( 'admin_init', 'register_studio_settings' );
|
||||||
@@ -223,7 +223,7 @@ $menus = wp_get_nav_menus( );
|
|||||||
<select name="front_menu_id">
|
<select name="front_menu_id">
|
||||||
|
|
||||||
<?php foreach($menus as $menu): ?>
|
<?php foreach($menus as $menu): ?>
|
||||||
<option value="<?php echo $menu->term_id ?>" <?php if($menu->term_id == get_option('front_menu_id')) echo ' selected="selected"'?> ><?php echo $menu->name ?></option>
|
<label for="front_menu_id">Hvilken meny skal fremsiden hentes fra?</label><option value="<?php echo $menu->term_id ?>" <?php if($menu->term_id == get_option('front_menu_id')) echo ' selected="selected"'?> ><?php echo $menu->name ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
@@ -231,4 +231,6 @@ $menus = wp_get_nav_menus( );
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php }
|
||||||
|
|
||||||
|
|
||||||
+17
-6
@@ -68,6 +68,7 @@ function showUrlModal(href)
|
|||||||
|
|
||||||
},
|
},
|
||||||
onClose: function (dialog) {
|
onClose: function (dialog) {
|
||||||
|
|
||||||
setLocationWithoutScrolling(preModal);
|
setLocationWithoutScrolling(preModal);
|
||||||
dialog.data.slideUp('fast', function () {
|
dialog.data.slideUp('fast', function () {
|
||||||
dialog.overlay.slideUp('fast', function () {
|
dialog.overlay.slideUp('fast', function () {
|
||||||
@@ -88,6 +89,9 @@ function setLocationWithoutScrolling(location)
|
|||||||
{
|
{
|
||||||
var from = $j("body").scrollTop();
|
var from = $j("body").scrollTop();
|
||||||
if(!from) from = $j("html").scrollTop();
|
if(!from) from = $j("html").scrollTop();
|
||||||
|
|
||||||
|
if(location.indexOf("#") == -1) location += "#";
|
||||||
|
|
||||||
window.location = location;
|
window.location = location;
|
||||||
$j("body,html").scrollTop(from);
|
$j("body,html").scrollTop(from);
|
||||||
}
|
}
|
||||||
@@ -109,21 +113,28 @@ $j(function()
|
|||||||
|
|
||||||
var modal_not_match = Array(/wp-admin/);
|
var modal_not_match = Array(/wp-admin/);
|
||||||
|
|
||||||
$j(".content .post [href],#header [href]").live('click',function(e)
|
$j(".content .post,#header [href]").live('click',function(e)
|
||||||
{
|
{
|
||||||
preModal = window.location.href;
|
preModal = window.location.href;
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
if($j(this).attr('href'))
|
||||||
|
href = this.href;
|
||||||
|
else
|
||||||
|
href = $j(this).find("[href]").attr('href');
|
||||||
|
|
||||||
for(var i = 0; i < modal_match.length; i++)
|
for(var i = 0; i < modal_match.length; i++)
|
||||||
if(this.href.match(modal_match[i]))
|
if(href.match(modal_match[i]))
|
||||||
break;
|
break;
|
||||||
if(i == modal_match.length) return;
|
if(i == modal_match.length) return;
|
||||||
|
|
||||||
for(var i = 0; i < modal_not_match.length; i++)
|
for(var i = 0; i < modal_not_match.length; i++)
|
||||||
if(this.href.match(modal_not_match[i]))
|
if(href.match(modal_not_match[i]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
showUrlModal(this.href);
|
showUrlModal(href);
|
||||||
e.preventDefault();
|
|
||||||
var href = this.href.substr(<?php echo strlen(home_url()) ?>);
|
href = href.substr(<?php echo strlen(home_url()) ?>);
|
||||||
window.location = window.location.href.split("#")[0] + "#" + href;
|
window.location = window.location.href.split("#")[0] + "#" + href;
|
||||||
});
|
});
|
||||||
$j("#simplemodal-overlay").live('click', function(){
|
$j("#simplemodal-overlay").live('click', function(){
|
||||||
|
|||||||
Reference in new issue
Block a user