Skip to content

Instantly share code, notes, and snippets.

@font-face {
font-family: Wendy;
src: local("Wendy"),
url(wendy.ttf);
}
@lschatzkin
lschatzkin / vimeo-embed.php
Created January 28, 2016 18:43
Embed vimeo via ACF using wp_oembed_get; custom field just holds id#
<?php
$video = get_post_meta($post->ID, "video_id", true);
while ( $video_query->have_posts() ) :
$video_query->the_post();
echo wp_oembed_get( 'https://vimeo.com/' . $video );
endwhile;
?>
@lschatzkin
lschatzkin / wp-url-bg.php
Last active May 30, 2016 17:38
wordpress background image from featured image
<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<header class="intro-header" style="background-image: url('<?=$url?>')">
@lschatzkin
lschatzkin / limitcontent.php
Created October 27, 2016 21:53
WordPress limit the_content() length
<?php
$content = get_the_content('read more', true);
$content = substr($content,0,900);
$content = apply_filters('the_content', $content );
$content = $content . '<a href="'.get_permalink().'">(Read More...)</a>';
echo $content;
?>