Trim excerpt to first paragraph

You can match this with regEx and easily choose the amount of paragraphs to return. // in context function triangle_x_excerpt( $text, $raw_excerpt ) { $content = apply_filters( ‘the_content’, get_the_content() ); $text = ( preg_match( sprintf( ‘~(<p>.+?</p>){%d}~i’, 1 ), $content, $matches ) ) ? $matches[ 0 ] : $content; return preg_replace( “/<img[^>]+\>/i”, “”, $text ); } … Read more

Get plugin to background of page

Your CSS file is loading fine, yes. But you need to add some more to it. z-index is used to say where to place an element in the ‘layers’, when elements overlap. The higher the z-index the higher it will appear. add z-index:10 to the header: header.site-header{ position: fixed; top: 0; margin: 0px; width: 100%; … Read more

I want different post-thumbnail size depending on media size

You can use the function [wp_calculate_image_srcset()][1], a helper function to return the srcset attribute value for an image ID, the different sizes need to exist, otherwise the function return false. Here is what a link with srcset look like, <img class=”alignnone size-full wp-image-122491 ” src=”http://example.com/wp-content/uploads/2016/03/C0101-012.jpg” alt=”C0101-012″ width=”2000″ height=”1200″ srcset=”http://example.com/wp-content/uploads/2016/03/C0101-012.jpg 2000w, http://example.com/wp-content/uploads/2016/03/C0101-012-656×394.jpg 656w, http://example.com/wp-content/uploads/2016/03/C0101-012-1024×614.jpg 1024w, http://example.com/wp-content/uploads/2016/03/C0101-012-1080×648.jpg … Read more

How to disable site title and description when custom header is uploaded on the customizer?

<div class=”table-cell”> <?php if ( has_custom_header() ) : ?> <?php the_custom_header_markup() ?> <?php else : ?> <h1 class=”blog-title”><?php bloginfo(‘name’); ?></h1> <h5 class=”blog-tagline”><?php bloginfo(‘description’); ?></h5> <div class=”image-title”><img src=”https://wordpress.stackexchange.com/questions/248807/<?php bloginfo(“template_url’); ?>/images/image.png” /></div> <?php endif ?> </div>