how to change the permalink to a specific location?

I have this slider on my front page. Right now when I click on an image it goes directly to the permalink and the post. How do I make all the slides go to one specific page?

this is the loop for the slider:

ul class="tm_magzslider"
    ?php 
    $recent = new WP_Query( array(  "cat" = $tmcategory, 
                                    "posts_per_page" = $tm_totalpost, 
                                    "post_type" = "post", 
                                 ) 
                          ); 
    while($recent-have_posts()) : $recent-the_post(); 
    ?

        ?php if (has_post_thumbnail()) { ?        
        lia href="?php the_permalink(); ?" title="?php the_title_attribute(); ?"
        img src="?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,"img737", true); echo $image_url[0]; ?" alt="?php echo get_the_title(); ?" title="?php echo get_the_title(); ?"
        /a/li       
        ?php } else { ?       
        lia href="?php the_permalink(); ?" title="?php the_title_attribute(); ?"
        img src="?php echo get_template_directory_uri(); ?/images/nophoto515.png" alt="?php echo get_the_title(); ?" title="?php echo get_the_title(); ?"
        /a/li
        ?php } ?

    ?php endwhile; ?
/ul

I changed the code to this but still it dosent work?:

?php if (has_post_thumbnail()) { ?        
        lia href="?php get_permalink(22); ?" title="?php the_title_attribute(); ?"
        img src="?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,"img737", true); echo $image_url[0]; ?" alt="?php echo get_the_title(); ?" title="?php echo get_the_title(); ?"
        /a/li       
        ?php } else { ?       
        lia href="?php get_permalink(22); ?" title="?php the_title_attribute(); ?"
        img src="?php echo get_template_directory_uri(); ?/images/nophoto515.png" alt="?php echo get_the_title(); ?" title="?php echo get_the_title(); ?"
        /a/li
        ?php } ?

    ?php endwhile; ?

Topic slideshow pages posts Wordpress

Category Web


Use echo get_the_permalink($id)(Your post $id) Or echo get_the_permalink()


echo get_permalink(123); instead of the_permalink(), provided you know the ID of the "specific page".

the_permalink() will always link to the current post in the Loop, and somewhat nonsensically does not take an ID parameter the way that get_permalink() does.

Reference: https://codex.wordpress.org/Function_Reference/get_permalink

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.