WordPress.org

Ready to get started?Download WordPress

Forums

Go to post when clicking on picture (3 posts)

  1. theodorkarlsen
    Member
    Posted 1 year ago #

    Hello! I am running this website whit wordpress: http://spillfreak.net/
    When you click on a picture on the frontpage, the picture is showing, but I want the whole post to show up! Is this possible?

    Sorry for my bad English.

  2. Archie22is
    Member
    Posted 1 year ago #

    Sure,

    You manually have to edit your post template. Have a look at this link: http://wordpress.org/support/topic/image-link-to-post-permalink

    Or you may want to create a function which will overwrite everything within single posts:

    function myImgreplacement_permalink($content) {
    	$format = get_post_format();
    	$searchfor = '/(<img[^>]*\/>)/';
    	$replacewith = '<a href=".get_permalink().'">$1</a>';
    
    	if (is_single() === FALSE AND $format == 'image') {
    		$content = preg_replace($searchfor, $replacewith, $content, 1);
    	}
    	return $content;
    }
    add_filter('the_content', 'myImgreplacement');

    Credit - throwingacbrick.com

  3. pdobariya
    Member
    Posted 1 year ago #

    hi, no need to edit code

    just goto admin >> pages >> find here your frontpage and edit it.

    here you had added images. click on image, you will find edit link on it.

    edit it image and popup will display now. in it you will find link option.

    add your choice of link to image and update.

Topic Closed

This topic has been closed to new replies.

About this Topic