bredom
12/14/2018 - 8:42 PM

Wordpress Settings

Useful settings for wordpress files

<?php
//Removing adding <br> and <p> tags to Wordpress posts
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

//Changing brackets in the the_excerpt() function
function new_excerpt_more($more) {
	global $post;
	return '<div><a class="fw-btn fw-btn-1 fw-btn-black" href="'. get_permalink($post->ID). '"><span>Czytaj całość </span></a></div>';
}
add_filter('excerpt_more', 'new_excerpt_more');

//Add custom css class to body_class function
function custom_body_classes( $classes ) {

	if ( 'post' == get_post_type() ) {
		$classes[] = "custom-class";
	}	

    return $classes;
}

add_filter( 'body_class', 'custom_body_classes' );