Support » Plugin: Content Views - Post Grid & List for WordPress » Get title of category post to show as title tag

  • Hi,

    Im searching accesibility. I want to display only the thumb, that’s ok, but I want to display the title tag on the div that wrap the thumb too, for adding a bit of accesibility. How I can do it? Im using the grid view.

    I think that the code to modify is that:

    		static function grid_item_wrap( $content_item ) {
    			$class = PT_CV_PREFIX . 'ifield';
    			return "<div class='$class'>$content_item</div>";
    		}

    Thanks!.

    • This topic was modified 2 months, 2 weeks ago by  Dreagnout.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Content Views

    (@pt-guy)

    Hi there,
    To add wrapper for the image, you can use add_filter for
    pt_cv_field_thumbnail_image_html, with 1 parameter (is the current output of image).
    then supply your own code of the wrapper div.
    Best regards,

    Can you paste all the PHP code that I need to insert? I’m a PHP newbie.

    Thanks.

    Plugin Author Content Views

    (@pt-guy)

    Here is how the code should look like:

    
    // ContentViews - wrap title around thumbnail
    add_filter( 'pt_cv_field_thumbnail_image_html', 'cvp_theme_field_thumbnail_image_html', 100, 1 );
    function cvp_theme_field_thumbnail_image_html( $args ) {	
    	// Add your code here to "display the title tag on the div that wrap the thumb"
    	
    	return $args;
    }
    

    You still need to add your own code for your need.

    Best regards,

    It gives me error 500 when I insert it in html.php

    • This reply was modified 2 months, 2 weeks ago by  Dreagnout.
    Plugin Author Content Views

    (@pt-guy)

    You should insert the code to the functions.php file of the theme.
    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.