• I am trying to change the byline on all pages to use the Author website link (from their profile), rather than the Author posts URL.

    I believe this change needs to be made in:

    /wp-content/themes/origin/library/functions/shortcodes.php

    /**
     * Displays an individual post's author with a link to his or her archive.
     *
     * @since 0.7.0
     * @access public
     * @param array $attr
     * @return string
     */
    function hybrid_entry_author_shortcode( $attr ) {
    
    	$post_type = get_post_type();
    
    	if ( post_type_supports( $post_type, 'author' ) ) {
    
    		$attr = shortcode_atts(
    			array(
    				'before' => '',
    				'after'  => ''
    			),
    			$attr,
    			'entry-author'
    		);
    
    		$author = '<span class="author vcard"><a class="url fn n" rel="author" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . get_the_author_meta( 'display_name' ) . '</a></span>';
    
    		return $attr['before'] . $author . $attr['after'];
    	}
    
    	return '';
    }

    I have tried replacing get_author_posts_url with get_the_author_link (link) but it’s not working for me.

    Any advice is appreciated!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Change Author Posts URL to Author Link’ is closed to new replies.