Wordpress HTML Question

16 replies
  • WEB DESIGN
  • |
On my site VPS-Review.net ... see when you click the images? It brings up the image in a fancy display-like thing? I want it to direct to the post instead.

I believe this is the HTML:

<div class="preload_image">
<a class="single_image" href="<?php $links=wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),full); echo $links[0]; ?>"><img src="<?php print_thumbnail_src('280','180') ?>" alt="single_review" /></a>
</div><!--end preload-->
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

What would I need to do to make it direct to the appropriate post instead of the image-thing?

Thank you!!
#html #question #wordpress
  • Profile picture of the author ChristineCobb
    Click on the image in your post/page editor and click the edit icon that appears on top of the image. You'll see a box that says "Link URL". Type the URL you want the image to link to in that box and save.
    Signature
    Creating an Affiliate Tools Page Couldn't Get Any Easier. Find out how.

    Free Screencast Videos Resource Guide Here
    {{ DiscussionBoard.errors[4977826].message }}
  • Profile picture of the author LukePeerFly
    Try this:

    HTML Code:
    <div class="preload_image">
    <a class="single_image" href="<?php the_permalink(); ?>"><img src="<?php print_thumbnail_src('280','180') ?>" alt="single_review" /></a>
    </div><!--end preload-->
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    Signature

    ^ My Blog

    Are you an affiliate that runs PPV advertising? You need my PPV target scraper!
    Have a Facebook Page? FPTraffic, manages over 1,000,000,000 (BILLION) Likes! Check it out :)
    {{ DiscussionBoard.errors[4977873].message }}
  • Profile picture of the author Ross Cohen
    Luke, didn't quite have luck with that. It just made the popup bring up the entire post.

    Chriscobb, think it's more of a backend sort of thing so every image leads to the post, not just the individual pic.
    {{ DiscussionBoard.errors[4977982].message }}
  • Profile picture of the author JF Garsula
    Try removing the class of "preload_image" or change it to another class.
    {{ DiscussionBoard.errors[4978185].message }}
  • Profile picture of the author Ross Cohen
    Would removing that alone make it go from bringing the pic up to making it go to the post though?
    {{ DiscussionBoard.errors[4978238].message }}
  • Profile picture of the author JF Garsula
    Sorry for not being clear. Try Luke's code and change/remove the class. You might have to add some CSS on the changed class. Just to make it look like the image before.

    Code:
    <!--Luke's Code-->
    <div class="a_preload_image_before_class"> <!-- changed class--> 
    <a class="single_image" href="<?php the_permalink(); ?>">
    <img src="<?php print_thumbnail_src('280','180') ?>" alt="single_review" />
    </a> 
    </div><!--end preload--> 
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    {{ DiscussionBoard.errors[4978265].message }}
  • Profile picture of the author Ross Cohen
    You're speaking a foreign language to me - haha.

    Is there anything I can provide to make the answer more clear-cut... like copy/pasting some HTML from elsewhere for you?
    {{ DiscussionBoard.errors[4978558].message }}
    • Profile picture of the author LukePeerFly
      Originally Posted by resellcells View Post

      You're speaking a foreign language to me - haha.

      Is there anything I can provide to make the answer more clear-cut... like copy/pasting some HTML from elsewhere for you?
      I would try to copy and paste what zaf101 posted.
      Signature

      ^ My Blog

      Are you an affiliate that runs PPV advertising? You need my PPV target scraper!
      Have a Facebook Page? FPTraffic, manages over 1,000,000,000 (BILLION) Likes! Check it out :)
      {{ DiscussionBoard.errors[4979276].message }}
  • Profile picture of the author Ross Cohen
    But in the space where it says <---changed class---> what would I place there?
    {{ DiscussionBoard.errors[4979332].message }}
  • Profile picture of the author xtrapunch
    Preloading images means the image is loaded even before it is requested by the user. It is a technique used often to load large images so that they are ready when user checks it out. It is not responsible for the pop-up windows. Some other code or plugin is responsible for this.


    By the way, you are using a theme which isn't very good with SEO. Alt="single_review"??? Are you trying to rank for "single review"?
    Signature
    >> Web Design, Wordpress & SEO - XtraPunch.com <<
    Web Design & SEO Agency | Serving World Wide from New Delhi, India

    {{ DiscussionBoard.errors[4979472].message }}
  • Profile picture of the author Sean3000
    Originally Posted by chriscobb View Post

    Click on the image in your post/page editor and click the edit icon that appears on top of the image. You'll see a box that says "Link URL". Type the URL you want the image to link to in that box and save.
    This was my first thought too. Did you try this? I'm not familiar with this theme, but by default WordPress points new images to a dedicated attachment page and not the post. Try going back to your posts and change the link settings for the images to the "Link to Post" option before you start banging your head against the wall screwing around with code.
    {{ DiscussionBoard.errors[4979821].message }}
  • Profile picture of the author Ross Cohen
    Hm yeah I didn't do the single_review... that was like that. As for trying it manually, ah, I thought that would do it! Was excited, never saw that "post URL" button... but did it and nothing changed Very strange...
    {{ DiscussionBoard.errors[4980189].message }}
    • Profile picture of the author xtrapunch
      Originally Posted by resellcells View Post

      Hm yeah I didn't do the single_review... that was like that. Very strange...
      I know the poor SEO image alt tags is due to the theme. Most of these Internet marketers offer themes that are bloated with codes and have poor SEO. I had created a website review theme a few months back for a client. That guy's original theme was very buggy and poorly coded.
      Signature
      >> Web Design, Wordpress & SEO - XtraPunch.com <<
      Web Design & SEO Agency | Serving World Wide from New Delhi, India

      {{ DiscussionBoard.errors[4982328].message }}
      • Profile picture of the author Evan-M
        Originally Posted by xtrapunch View Post

        I know the poor SEO image alt tags is due to the theme. Most of these Internet marketers offer themes that are bloated with codes and have poor SEO. I had created a website review theme a few months back for a client. That guy's original theme was very buggy and poorly coded.
        or wordpress added the alt tag like this_is_my_image.jpg would have a alt of this_is_my_image by default


        try adding target="_parent"

        sounds like you have fancy box plugin and its taking over the link
        Signature

        Evan-M

        Easily The Worlds Best Wordpress Popup plugin

        Visit Website Design Firm For All Your Wordpress Coding Needs

        {{ DiscussionBoard.errors[4983890].message }}
  • Profile picture of the author JF Garsula
    @xtrapunch
    Yeah you're right, I didn't find out when I checked out the site. The reason why I removed the class preload_image because, I usually use the preloaded images to load the fancybox/lightbox popup.

    @resellcells

    The <!--changed class--> is just a comment in HTML it won't do anything to the codes.
    Copy and paste the code below:

    Code:
    <div class="preload_image"> 
    <a href="<?php the_permalink(); ?>"> 
    <img src="<?php print_thumbnail_src('280','180') ?>" alt="single_review" /> 
    </a>  
    </div><!--end preload-->  
    <h2>
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    </h2>
    I just removed the class="single_image" because it loads the popup. You can check out the custom.js.
    {{ DiscussionBoard.errors[4981767].message }}
  • Profile picture of the author Ross Cohen
    Zaf, perfect. Code works perfectly! Thanks so much everyone for helping!
    {{ DiscussionBoard.errors[4984926].message }}

Trending Topics