• Hi! I love this plugin! I was trying to use the code you provided so that the guest posts author matches the actual author, however the code you have specified is not in my php. The only code I have is:
    $author = get_current_user_id();

    Could you tell me what code I’d need to change it to? When I replaced it with:
    !empty(get_post_custom_values(‘author’, get_the_ID())[0]) ? get_post_custom_values(‘author’, get_the_ID())[0] : get_the_author()

    I got a fatal error message and my plugin was rendered inactive : (

    Thank you for your help!

    https://www.ads-software.com/plugins/tt-guest-post-submit/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Rashed Latif

    (@rashedlatif)

    Hi
    This code you need to look at your theme files. Find similar code which is described in the tutorial in your theme files and replace that code.
    You dont need to replace any code in plugin.
    Hope that helps.

    Thread Starter EveofReduction

    (@eveofreduction)

    Thank you for your quick reply! I’m using the Canvas theme. I searched the theme code and could not find that exact code. This is what I have:

    $author = '';
    				$author_text = '';
    
    				// If we need to display either the author, URL or both, get the data.
    				if ( $args['display_author'] == true || $args['display_url'] == true ) {
    					$meta = get_post_custom( $post->ID );
    
    					if ( isset( $meta['feedback_author'] ) && ( $meta['feedback_author'][0] != '' ) && $args['display_author'] == true ) {
    						$author .= '<cite class="feedback-author">' . $meta['feedback_author'][0] . '</cite><!--/.feedback-author-->' . "\n";
    					}
    
    					if ( isset( $meta['feedback_url'] ) && ( $meta['feedback_url'][0] != '' ) && $args['display_url'] == true ) {
    						$author .= '<a href="' . esc_url( $meta['feedback_url'][0] ) . '" title="' . esc_attr( $author_text ) . '">' . esc_url( $meta['feedback_url'][0] ) . '</a>';

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    I have no idea what I’d change in there. Thank you for your support and I understand if this is outside your realm.
    Kindest regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Author Code not working’ is closed to new replies.