CodeHQ

Archive for September, 2016

|

Change ellipses on excerpt | WordPress

Friday, September 30th, 2016

Add to functions.php file.

function ld_new_excerpt_more($more) {
    global $post;
    return '...';
}
add_filter('excerpt_more', 'ld_new_excerpt_more');

Tags: , , ,
Posted in PHP, WordPress | No Comments »

Add thumbnail theme support | WordPress

Friday, September 30th, 2016

Add this to the functions.php file.

add_theme_support( 'post-thumbnails' ); 

Tags: , , , ,
Posted in PHP, WordPress | No Comments »

Custom search form for WordPress

Friday, September 30th, 2016

Create a file named searchform.php and place this in the root of the theme folder. This will replace the default WordPress search form.

<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
    <input type="text" placeholder="<?php echo esc_attr_x( 'Search website...', 'placeholder' ) ?>"
            value="<?php echo get_search_query() ?>" name="s"
            title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>"/>
</form>

Tags: , , , , ,
Posted in PHP, WordPress | No Comments »