Forum Replies Created

Viewing 5 replies - 76 through 80 (of 80 total)
  • Thread Starter dukearmi

    (@dukearmi)

    @diggeddy I’m happy to report that I haven’t seen the error for the past 3 days! Thank you so much for your help ??

    Thread Starter dukearmi

    (@dukearmi)

    Hi David,

    Thank you very much! I’ll follow your advice and report if it resolves the issue in the next few days.

    Thread Starter dukearmi

    (@dukearmi)

    Hi Fernando,

    I’m adding the custom fucntions with PHP code using the Code Snippets plugin. I haven’t tried removing it because it would mess with the post meta on the frontend. Here’s the code if it helps:

    add_filter( 'generate_post_date_output', function( $output, $time_string ) {
        $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published on %2$s</time>';
    
        $updated_time = get_the_modified_time( 'U' );
        $published_time = get_the_time( 'U' );
    
        if ( $updated_time > $published_time ) {
            $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Updated on %4$s</time>';
        }
    
        $time_string = sprintf( $time_string,
            esc_attr( get_the_date( 'c' ) ),
            esc_html( get_the_date() ),
            esc_attr( get_the_modified_date( 'c' ) ),
            esc_html( get_the_modified_date() )
        );
    
        return sprintf( '<span class="posted-on">%s</span> ',
            $time_string
        );
    }, 10, 2 );
    
    add_filter( 'generate_post_author_output', function() {
        return sprintf( ' <span class="byline">%1$s</span>',
            sprintf( '<span class="author vcard" itemtype="https://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<a href="%1$s" title="%2$s" rel="author"><span class="author-name" itemprop="name">%3$s</span></a></span>',
                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
                esc_attr( sprintf( __( '', 'generatepress' ), get_the_author() ) ),
                esc_html( get_the_author() ),
                get_avatar( get_the_author_meta( 'ID' ) )
            )
        );
    } );
    
    add_filter( 'author_link', function( $link, $author_id ) {
        if ( 1 === $author_id ) {
            return 'https://www.example.com/author';
        }
        return $link;
    }, 10, 2 );
    
    add_filter( 'generate_header_entry_meta_items', function() {
        return array(
    		'author',
    		'date',
    		
        );
    } );
    
    /*
    add_action( 'generate_after_header', function() 
    		   {
    			   if ( is_single() ) {
    if (function_exists('rank_math_the_breadcrumbs')) 
    {
    rank_math_the_breadcrumbs(); 
    }
    		   }} );
    */
    add_filter( 'generate_show_title', '__return_false' );
    add_action( 'generate_after_header', function() {
    	if ( ! is_front_page() && ! is_archive() ) {
        the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
    }} );
    
    add_filter( 'generate_footer_entry_meta_items', '__return_null' );

    The last line of code has “return_null” in it so it might have something to do with the error.

    I used a text compare tool and it showed that my post-meta.php is the same as the one in the link your povided (no changes).

    Thread Starter dukearmi

    (@dukearmi)

    Hi David,

    The error provides no additional details. The only stack trace I found was from September last year.

    Thread Starter dukearmi

    (@dukearmi)

    Hi David,

    It doesn’t provide any other information. The only stack trace I found in the error log was from September last year.

Viewing 5 replies - 76 through 80 (of 80 total)