Does your project call for you to insert an ad, graphic, or some other type of content between posts? If so, there’s a very easy solution. A typical loop looks like this, taken from the twentyfourteen theme: if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( ‘content’, get_post_format() ); endwhile; else : get_template_part( ‘content’, ‘none’ […]
Tag: Snippets
Categories
Loading a Google Font in WordPress
function load_fonts() { wp_enqueue_style(‘googleFonts’, ‘http://fonts.googleapis.com/css?family=Montserrat:400,700’); } add_action(‘wp_enqueue_scripts’, ‘load_fonts’); The proper way to load an external font library, such as from Google Fonts, is to use the wp_enqueue_scripts hook. You can use the above sample code in your functions.php code or load it up via a custom plugin. Breaking it down Couple of key points: “wp_enqueue_script” […]