Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Camille V

    (@socrapop)

    Dear @sermalefico,

    Unfortunately, not yet. Custom titles/excerpt and thumbnail are kind of new and I did not think of hooks yet to add some more.
    I’m currently working on V2.0, which include a major code rewrite and refactoring because the plugin is becoming a lot bigger than I expected in the first place ^^.

    I’m not yet grasping the concept of integrating custom hooks, but I will certainly have a look after this big update is out, and I will try to add them in V2.1 ??

    Have a nice day,
    Camille

    Thread Starter sermalefico

    (@sermalefico)

    If you want you can take a look at this plugin that has a template system for what is shown in the popover.

    Locate and filter plugin

    Thx Camille!

    Thread Starter sermalefico

    (@sermalefico)

    I resolved it customizing the default excerpt of the post like this:

    
    add_filter( 'get_the_excerpt', 'themeprefix_excerpt_read_more_link' );
    
    function themeprefix_excerpt_read_more_link( $output ) {
    	global $post;
    
    $yourfield =  get_field( "your_field_slug", $post->id );
    		
    if( is_tax() ) { // customize output in category		
    		return $output . ' <a href="' . get_permalink( $post->ID ) . '" class="more-link" title="View More">' . $yourfield . ' View More</a>';//change read more text
    	}
    	if( is_single() ) { // customize output in single posts
    		
    	return $output . ' <a href="' . get_permalink( $post->ID ) . '" class="more-link" title="View More"> ' . $yourfield . ' jajajaja</a>';//change read more text
    	
    } else { // what all the other type of templates 
    	
    return $output . ' <a href="' . get_permalink( $post->ID ) . '" class="more-link" title="Read More">Read More</a>';
    
    	}
    }
    
    

    Whith this you can manipulate the excerpt in the popover and put any custom field related to the post

    I don’t know if it’s the best way, but I think it’s worth it

    • This reply was modified 3 years, 12 months ago by sermalefico.
    • This reply was modified 3 years, 12 months ago by sermalefico.
    Plugin Author Camille V

    (@socrapop)

    Thank you for this, I get the idea, and a custom hook would be a lot better indeed ??
    Your solution only works if your theme doesn’t use get_the_excerpt anywhere else, but I’m glad you succeded what you wanted to do before my update, which is coming in a pretty long time I think :/ (V2.0 is pretty huge)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Retrieve Custom fields posts’ is closed to new replies.