Viewing 1 replies (of 1 total)
  • Hi @alwicz

    To do as such, you can try this code:

    add_filter( 'wpsp_author_output', 'tu_wpsp_remove_author_link', 10, 1);
    function tu_wpsp_remove_author_link($output) {
    	global $wpsp_id;
    	if( '1557' === $wpsp_id){
        printf(
            '<span class="wp-show-posts-byline wp-show-posts-meta">
                <span class="wp-show-posts-author vcard" itemtype="https://schema.org/Person" itemscope="itemscope" itemprop="author">
                     <span class="author-name" itemprop="name">%1$s</span>
                </span>
            </span>',
            esc_html( get_the_author() )
        ); } else { return $output; }
    }
    
    add_filter( 'wpsp_date_output','tu_remove_date_link', 10, 1 );
    function tu_remove_date_link( $output ) {
    	global $wpsp_id;
    	$time_string = '<time class="wp-show-posts-entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';
    
    			if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    				$time_string .= '<time class="wp-show-posts-updated" datetime="%3$s" itemprop="dateModified">%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() )
    			);
    	if( '1557' === $wpsp_id){
    		printf(
    				'<span class="wp-show-posts-posted-on wp-show-posts-meta">%3$s
    				</span>',
    				esc_url( get_permalink() ),
    				esc_attr( get_the_time() ),
    				$time_string
    			);
    	} else { return $output; }
    }
    
    add_filter( 'wpsp_terms_output', function( $output ) {
    	global $wpsp_id;
    	if( '1557' === $wpsp_id){
        	return strip_tags( $output );
    	} else { return $output; }
    } );

    Kindly replace all 1557 values to the respective ID of your specific WPSP list.

    Hope this helps! ??

Viewing 1 replies (of 1 total)
  • The topic ‘WP Show Posts – Remove links from meta items’ is closed to new replies.