Moesia latest news. Change or delete url to posts

Hello,

I hope you are well!

I am trying to change or delete the url, which brings me to the post page, when I click on the image in lastest news.

Any idea how I can unable the url or change it?

Thanks a lot

Hello there,

It can be done by adding custom jQuery script; follow these steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box

;(function($) {

   'use strict'

   if( $('.latest-news-area').length ) {

    var newURL = 'http://yoursite.com/new-url'; // New URL
    
    $('.all-news').attr('href', newURL);
    
   }

})(jQuery);
   

  1. Update

To remove the URL, change this line:


var newURL = 'http://yoursite.com/new-url'; // New URL

with:


var newURL = '#'; // New URL

Regards,
Kharis

Hi Kharis,

thanks a lot!

I followed your steps, but a click on the image still brings me to the post page.

Hello there,

I am sorry the code didn’t work for you. Please use this code:


;(function($) {

   'use strict'

   if( $('.latest-news-area').length ) {

    var newURL = 'http://yoursite.com/new-url'; // New URL
    
    $('.latest-news-area .blog-post').each( function() {

        $(this).find('.entry-thumb a').attr('href', newURL);
        
    });
    
   }

})(jQuery);

Regards,
Kharis