This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( is_home() || is_single() || is_search() || is_archive() ) { echo 'current_page_item'; } ?>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// show sort submenu on click in phone / table | |
$(".hasChild").click(function() { | |
if($(this).hasClass('showUl')) { | |
$('.hasChild').removeClass('showUl'); | |
$(this).removeClass('showUl'); | |
} else { | |
$('.hasChild').removeClass('showUl'); | |
$(this).addClass('showUl'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(d) { | |
var tkTimeout=3000; | |
if(window.sessionStorage){if(sessionStorage.getItem('useTypekit')==='false'){tkTimeout=0;}} | |
var config = { | |
kitId: 'a1b2c3f4', | |
scriptTimeout: tkTimeout | |
}, | |
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+"wf-inactive";if(window.sessionStorage){sessionStorage.setItem("useTypekit","false")}},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+="wf-loading";tk.src='//use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s) | |
})(document); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Loop --> | |
<?php | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
$args= array( | |
'post_type' => 'aktuellt', | |
'posts_per_page' => 3, | |
'paged' => $paged, | |
); | |
query_posts($args); while ( have_posts() ) : the_post(); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpb_imagelink_setup() { | |
$image_set = get_option( 'image_default_link_type' ); | |
if ($image_set !== 'none') { | |
update_option('image_default_link_type', 'none'); | |
} | |
} | |
add_action('admin_init', 'wpb_imagelink_setup', 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Styra längd på excerpt | |
function get_excerpt($count){ | |
$permalink = get_permalink($post->ID); | |
$excerpt = get_the_content(); | |
$excerpt = strip_tags($excerpt); | |
$excerpt = substr($excerpt, 0, $count); | |
$excerpt = $excerpt.'...'; | |
return $excerpt; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $trim_length = 120; //desired length of text to display | |
$custom_field = 'om_omrade'; | |
$value = get_post_meta($post->ID, $custom_field, true); | |
if ($value) { | |
echo rtrim(substr($value,0,$trim_length)) . '...'; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (strlen($post->post_title) > 25) { echo substr(the_title($before = '', $after = '', FALSE), 0, 25) . '...'; } else { the_title();} ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'orderby' => 'name', | |
'child_of' => 12 | |
); | |
$categories = get_categories( $args ); | |
foreach ( $categories as $category ) { | |
echo '<li><a href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a></li>' ; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add class to active cat | |
function tax_cat_active( $output, $args ) { | |
if(is_single()){ | |
global $post; | |
$terms = get_the_terms( $post->ID, $args['taxonomy'] ); | |
foreach( $terms as $term ) | |
if ( preg_match( '#cat-item-' . $term ->term_id . '#', $output ) ) | |
$output = str_replace('cat-item-'.$term ->term_id, 'cat-item-'.$term ->term_id . ' current-cat', $output); |
NewerOlder