Anchors not working on search results page using woocommerce - wordpress

I am developing a site for a client using Wordpress and Woocommerce and have an issue where I can not click on any of the anchors on the search results page.
The search results page is here: http://79.170.44.83/newcityused.com/?s=chair
I can see nothing in the CSS that would make this happen.
I have deactivated all of the plugins with no joy.
I'm lost.
Has anyone else experienced this or know of a solution?

You have a class .search inside your 'body' tag and then you have a js that is something like this:
jQuery(function(){
jQuery('.search').on('click', function(e) {
jQuery('.search-form').toggleClass("expand");
e.preventDefault();
});
})
I think that you are preventing the default clicks in here... so remove the e.preventDefault it made work, let me know...

Related

NEED HELP - how to make an excerpt of the post clickable?

I am working in Wordpress, and I am using Elementor. Elementor has a native feature for the title of the posts and images to link to the post.
But if I add an excerpt text, it doesn't link to the post. It is not clickable. The read more button does, but not the excerpt of the post.
I am trying to create something like this: greatist.com Every post on their website is clickable - the excerpt, the title, and the image.
My excerpts are really short like on that website, and I would really like them to be clickable. I have absolutely no idea how to do this and I'm beginning to think it's not possible. I am using Hello Elementor theme.
I would deeply appreciate anyone's help. I just registered to ask this question.
You can always try to save text as an photo and make it clickable or make a full section clickable.To do this try to use plugin called "Make Column Clickable Elementor".
Add this code to your website:
const postExcerpts = document.querySelectorAll('.elementor-posts .elementor-post .elementor-post__excerpt');
postExcerpts.forEach(postExcerpt => {
const postUrl = postExcerpt.parentNode.querySelector('.elementor-post__title a').href;
postExcerpt.addEventListener('click', () => {
window.location.href = postUrl;
});
});
This can be added using a script tag. Choose from the following options:
Add this code as a script tag in your functions.php file, to be rendered at the end of the page (wp_footer action hook).
If you have Elementor Pro, use its built-in Custom Code feature to add the code in a script tag to the end of the body tag.
It's recommended to add a pointer cursor so the user will know the excerpt is a link. This can be achieved by adding the following CSS to your style.css file.
.elementor-posts .elementor-post .elementor-post__excerpt {
cursor: pointer;
}

how to make rss feeds unclickable in wordpress

i have created wordpress blog and i added the rss widget that comes with wordpress.
but i need to make the rss feeds unclickable to so that my blog visitors will stay in my site and not leave, so i want clicking on an item in the feeds to do nothing.
i have tried to look in rss.php file but i didn't know what to do...
i want the href to be removed.
or if anyone can suggest a rss widget plogin that doesn't link to its source!
can anyone please help me with that?
You can disable clicks using jQuery. Try adding this to your functions.php.
add_action('wp_footer','unclickable_rss');
function unclickable_rss() {
?>
<script>
jQuery(document).ready(function($) {
$('.widget_rss a').on('click',function() {
return false;
});
});
</script>
<?php
}

How do i disable submenu links in wordpress?

As soon as you create a menu item for a page there is a link that it automatically populated with it. How do i stop wordpress from making these links? I'm capable of making them myself and don't always want them to link to thier specific page.
I figured it out using and dropping it in my header.php
<script type="text/javascript">
jQuery(function($) {
$("li.menu-item-627,li.menu-item-14,li.menu-item-20,li.menu-item-28").children("a").attr('href', "javascript:void(0)");
});
</script>
You have to use firebug or chrome "inspect element" to find out what your menu items are and then just replace the numbers in the code accordingly.
also if you don't want them to show up at all add the following code
<script type="text/javascript">jQuery(function($) { $("li.menu-item-627").contents().hide();});</script>
those two together will hide the disabled menu link
you can then add your own links in the "navigation label" of the page menu field!
good luck and let me know if you have any questions, i will do my best to help!

Multiple product views in WooCommerce with rollovers

I am developing an ecommerce site with WooCommerce and I'm trying to add multiple product views that when clicked or on hover, replace the main image. The stock code opens the thumbnails attached to the post in fancy box, which I don't prefer. I have looked all over and found only a couple of plugins that come close but are still far away from my desired effect.
What I am looking for, ideally, is a plugin or code I can add to my functions that when you rollover a thumbnail it replaces the main image with the new one. If that isn't possible, I need it to at least replace it when clicked.
Any help is extraordinarily appreciated.
I found this http://www.magictoolbox.com/magiczoomplus/ and it handles what I needed. I just set the zoom to inner so it doesn't open a zoom window and it has thumbnail hover that replaces the main image. Maybe this could help someone with a similar issue.
Honestly I don't see why you need a plugin to do this at all, regular javascript/jQuery will work just fine.
$( ".smallImage" ).hover(function() {
var smallSrc = $(this).attr("src");
$( "#bigImage" ).attr("src", src );
}, function() {
// Code here for mouse out
}
);

How to use ajax pagination in wordpress

I have created custom post type 'portfolio' in my wordpress application.
I am using wp-pagenavi plugin for pagination of custom posts.Can anyone guide me how will I implement ajax pagination i.e load newer posts without reloading the whole page. Any help will be greatly appreciated...
/*******ajax pagination*******/
jQuery(document).on('click', '#pagination a', function(e){
e.preventDefault();
var link = jQuery(this).attr('href');
jQuery('#content').html('Loading...'); //the 'main' div is inside the 'content' div
jQuery('#content').load(link+' #main');
});
the .live() function has been depreciated so use .on() instead.
obviously the jQuery library is needed too.
Here's a couple of options you can try:
AJAXify WordPress Tutorial
AJAXify WordPress Plugin
I've used the first option, its a good tutorial. I know it works. You may need to modify it some though. I cannot vouch for the second option as I've never used it. Just a quick Google search turned it up though.

Resources