I want the wordpress post image to have the post link - wordpress

I am new to Wordpress
I am implementing a custom theme that is derived from the parent theme tewnty twelve.
I want something like bellow:
I am uploading media that will be inserted inside the post. We know that when we click on the post title, it takes us to the full post page. But when i click on the image inside the post, it takes me to the url like this: www.mohin.com/?attachement_id=10 which i don't want. I want the image click takes me to the full post page as the title click does.
Is there anyone who can help me on this issue
Any help is appreciated.
Thanks,
mohin

Yeah it's pretty straightforward. Just select the image in your post editing window, select the hyperlink icon, and paste the URL you want the link to go to. Update and then check. When clicking the image it should go to that link.

Related

Image link in wordpress

How can I get the image link in WordPress media?
Thank you!!
It shows that you need to put a custom link here if you want to connect to any site with this image. For example, you displayed this image in your site's content area where you want to click on that image and it will redirect to that specific page. Also you can put a custom link to another site whare you can set the link target, it will open in same window or in a new window. Hope it will make a sense for you.

wordpress theme - links (relative or hardcoded)

I am using a wordpress theme and am confused about links to other pages.
there are places where I can add a link to an existing button but I am not sure whether the link should be hardcoded or not.
e.g.
www.mysite/wordpress/?page=123
or
?page=123
Also if I have to hardcode it, should I be using https://??
This is not HTML, its like a textbox where you can add a link for a button, I guess the theme provides it.
Here is an image which shows how you can add a link to a button, it askes for a link, I would want to link to my contact page, what should i enter here?
Apologies this is all new to me.
As i know you can hardcode it. Like in Title
I use this code for
<?php the_title();?><?php the_permalink();?>
it will link to the page according to the title of the page/posts.
hope this helps

Wordpress - Image lightbox with different image when clicked

For my wordpress site, I need some images arranged in a grid and when one is clicked a specific (different) image is displayed bigger. I thought that there maybe is a lightbox/gallery plugin, where one enters the link for the small and big picture, and I can just use the link to a different image instead of to the same one, but bigger. Does anyone know a plugin that works like that? Or any other way to make that work?
You can use "WP Gallery Custom Links" plugin to set different image link by using "custom URL" option.
Simply go to a post or page and create a new gallery. You will see the custom link meta fields for individual images in a gallery.

Creating a preview in wordpress

I would want to create a preview in wordpress that would look different than the normal post. I know how I can shorten the text but I want the whole post to have a different css when you click on the link that will send you to page where the post is. I will appreciate any answer or hint. Thanks
You can use Page Templates. Its not available on posts, only on pages but it will look the same. Create a new page, select a different template and click preview.

How to insert an image into a post without linking to the attachment page

I'm displaying the content in wordpress, I'm usint the_content inside of the loop and everything is working great, I get an image and the text of the post.
The only thing that I don't want is that the image link would take you to the attachment page, I want the user to be directed to post permalink.
You can control the nature of the image inserted into the post via the Visual Editor. Click on the image, and select "Edit Image". Then, find the option for "image links to" (file, page, or none). Change from "page" to either "file" or "none".
Edit the post and change the URL the image points to. You can do this by clicking the little edit icon when you click on the image.
Alternatively, remove the image link altogether.

Resources