Excerpts not showing on main page

by Mooiman   Last Updated November 08, 2017 19:08 PM

I made my first wordpress child theme, but it's not working correctly. This is my coding:

// custom excerpt length
function themify_custom_excerpt_length( $length ) {
   return 20;
}
add_filter( 'excerpt_length', 'themify_custom_excerpt_length', 999 );

//show logged-in menu and logged out menu
function my_wp_nav_menu_args( $args = ” ) {
if ($args[‘theme_location’] == ‘primary’) {
if( is_user_logged_in()) {
$args[‘menu’] = ‘logged-in’;
}else{
$args[‘menu’] = ‘logged-out’;
}
}
return $args;
}
add_filter( ‘wp_nav_menu_args’, ‘my_wp_nav_menu_args’ );


//Post database text on each post page within the loop
add_filter( 'the_content', 'my_the_content_filter', 20 );

function my_the_content_filter( $content ) {
    if ( is_single() ){
    $newcontent="here will be some data retrieved from the database, it will be beneath every post. I like it!";        
    $content .= $newcontent;
    return $content;}
}

Problem is that my excerpts don't show up on the main page. I think this is related to the return $content part in my last function. If I remove my child theme the excerpts do show up, so there must be something wrong with my coding.

Anyone got a clue on how to get this working?



Related Questions



the_content interrupts sidebar

Updated May 27, 2015 01:03 AM

Hide specific content from excerpts

Updated July 05, 2016 08:03 AM