Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author pepe

    (@pputzer)

    The behavior of featured images depend on how your theme uses them. If the theme does not use the post_thumbnail_html filter hook, you have to integrate the credit into your templates manually.

    Plugin Author pepe

    (@pputzer)

    @himanshu_ag Please check if your theme uses the the_post_thumbnail function to display post thumbnails. If not, you will have to integrate media credits into your templates manually (the API is described on the plugin website).

    Plugin Author pepe

    (@pputzer)

    @himanshu_ag Have you been able to resolve the issue?

    Plugin Author pepe

    (@pputzer)

    I assume the issue has been resolved.

    Thread Starter Himanshu

    (@himanshu_ag)

    Hey, post credit is work … still Credit not Display for featured images. on my site Request to check

    Plugin Author pepe

    (@pputzer)

    Sorry, @himanshu_ag, I didn’t get that. Have you had a look at your theme’s featured image implementation? Does it use function the_post_thumbnail or not?

    Thread Starter Himanshu

    (@himanshu_ag)

    Hi have checked wp-includes / post-thumbnail-template.php did not get properly Request to check below code

    /**
     * Display the post thumbnail.
     *
     * When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size
     * is registered, which differs from the 'thumbnail' image size managed via the
     * Settings > Media screen.
     *
     * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image
     * size is used by default, though a different size can be specified instead as needed.
     *
     * @since 2.9.0
     *
     * @see get_the_post_thumbnail()
     *
     * @param string|array $size Optional. Image size to use. Accepts any valid image size, or
     *                           an array of width and height values in pixels (in that order).
     *                           Default 'post-thumbnail'.
     * @param string|array $attr Optional. Query string or array of attributes. Default empty.
     */
    function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
    	echo get_the_post_thumbnail( null, $size, $attr );
    }
    

    and assit

    Plugin Author pepe

    (@pputzer)

    That’s the function in WordPress core. You need to look at your theme’s files.

    Thread Starter Himanshu

    (@himanshu_ag)

    I think this code will help you `if ( ! function_exists( ‘jobcareer_get_post_img’ ) ) {

    function jobcareer_get_post_img( $post_id, $width, $height ) {
    $image_id = get_post_thumbnail_id( $post_id );
    $image_url = wp_get_attachment_image_src( $image_id, array( $width, $height ), true );
    if ( $image_url[1] == $width and $image_url[2] == $height ) {
    return get_the_post_thumbnail( $post_id, array( $width, $height ) );
    } else {
    return get_the_post_thumbnail( $post_id, “full” );`

    • This reply was modified 9 years ago by Himanshu.
    Plugin Author pepe

    (@pputzer)

    And is that function jobcareer_get_post_img actually used? If so, please point me the images on an example page that are the output of that function. Also, look whether and where that function is used, the code may be stripping out things from the returned HTML markup.

    Plugin Author pepe

    (@pputzer)

    @himanshu_ag I’m sorry, but I’m closing this thread. If you are not “fluent” yourself, you need to hire a PHP developer to do the necessary theme customizations. This goes way beyond the remit of this support forum.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Credit not Display for featured images.’ is closed to new replies.