how to locate a custome php function - php

I am a c# developer but I have a website for my family business that has been developed using PHP, woocommerce and wordpress about 5 years ago by a developer that I can't connect with him anymore. the problem is as following:- I did an update to the woocomerce plugin so I can use quick books when I did that the update the category page (which I know for a fact that he did custom build it ) lost the text under the images, I did inspect the elements in the browser, the text is their but there is a lot of space that why it is hidden , i don't know why this happened after the update but anyways, when I checked the page tab in the wordpress I did find this line of code
<pre class="brush: php; gutter: false">[product_categories per_page="12" columns="3" orderby="date" order="asc"]</pre>
As I said I don't know much of PHP but I expect "product_categories" is a function located in some file
also when I checked the inspect tab in the browser I found that the text and the image of the category is inheriting form class "product-category" "product" "first"
this is the line of the html of one of the categories just to have a better idea
<li class="product-category product first">
<a href="https://www.WebsiteName.ca/product-category/backdrops/">
<img src="https://www.WebsiteName.ca/wp-content/uploads/2017/02/backdrops- 300x300.jpg" alt="Backdrops" srcset="https://www.mosaiceventrentals.ca/wp- content/uploads/2017/02/backdrops-300x300.jpg 300w, https://www.WebsiteName.ca /wp-content/uploads/2017/02/backdrops-150x150.jpg 150w, https://www.WebsiteName.ca/wp-content/uploads/2017/02/backdrops-180x180.jpg 180w" sizes="(max-width: 300px) 100vw, 300px" width="300" height="300">
<h2 class="woocommerce-loop-category__title">
Backdrops
<mark class="count">(10)</mark>
</h2>
</a></li>
-I did try to download all the files from the server and search in each file for this function but no luck
I checked the bootstrap file for for the function "product-category" "product" "first" but I didn't find these classes
Basically I want to remove all extra space so the title can appear under the image but I want to know how to locate the file it is coded in

so after searching for a while I started to think out side of the box and discovered that the their was a line spacing error in the paragraph before the category list that was affecting the appearance of category titles. one other thing I found is that the new update for the woocommerce have a function to create a category list that link to the list of products under each category and the styling is much better than the custom made one.
just a reference to do that is as following:-
1- Dashboard --> Products --> Categories and you can add, edit and delete categories
2- in order to view the shop page as categories NOT the products you go to Dashboard --> Appearance --> customize --> woocommerce --> Product Catalog --> then select Show categories
3- then in order to add the welcome paragraph just go to Dashboard-->Pages--> All Pages select the shop page and click edit and just write the welcome paragraph.
thanks everyone for your help and suppourt

Related

Template for Woocommerce Galery Carousel - Flex Control Thumbs

I need to place something right after this element exactly:
<ol class="flex-control-nav flex-control-thumbs"></ol>
It's standard Woocommerce product gallery carousel on single product page, under main thumbnail. I was trying to find this is product-image.php and product-thumbnails.php but it's not there, I tried in different places. I need to add custom action under it.

Display Woocommerce products in tabs and lightbox on category page

I'm using a plugin that allows me to have tabs filtering on Woocommerce category page. I also want to have a lightbox opening when clicking on a product (and not linking to a product page), but when installing the Category tabs plugin, there was a conflict and it doesnt work together.
So I modified the Category Tabs Plugin code to insert the Lightbox manually and it's almost working. The lightbox opens but I have an error "image path is incorrect".
<a href="<?php echo get_the_post_thumbnail( $post->ID, apply_filters(); ?>" data-rel="prettyPhoto">
When i make a test with an absolute path of image, it's working well, the lightbox is opening.
So i'm just missing the right dynamical PHP Path to call the product image, I know i'm close but I'll need a little help for that !!
Thank you in advance for your kindness.
Caroline
error message

Wordpress: How can I create an external page or file that contains posts with 1 specific category?

I'm developing a blog and custom theme with WordPress. My homepage has the 5 most recent posts with 4 divs. Each div has a specific title like 'Personal Stories' or 'Tutorials'. I have created, within the WordPress manager, the 4 corresponding categories. I am quite new to PHP and WordPress in general, and I was wondering if it was possible to somehow add an anchor to each of those 4 divs; that link to an external page with a list of posts with those specific categories?
I've tried creating new PHP files and linking the index.php file to them with an <a> tag, but I just simply get an 'ERROR 404'. I was hoping to implement 'The Loop' on these pages and filter the posts to just those with a specific category.
I've also tried using WordPress functions that create a URL with the category ID. As the divs do not have categories, I manually find them. In the end, I get something like this:
<a href="<?php get_category_link( 3 ); ?>">
<div id='story' class='circle'>
<p class='text'><br>People Stories</p>
</div>
</a>
And this is assuming that the number '3' is the ID I found when manually checking the categories.
Yes,
I added a
<a href="?cat=3">
<div id='#' class='#'>
<p class='#'>...</p>
</div>
</a>
When I clicked on the <div>, it took me to the category.php page.
Thank you

Woocommerce Recently Viewed Products Wordpress

I want to include in my website the " Recently Viewed Produdcts" widget. I found out that i can do that with a shortcode as mentioned here: http://www.wpexplorer.com/woocommerce-recently-viewed-products-shortcode/
After implementing this code and creation of plugin the products appear in homepage very weird, very big and without any styling. Then i found out that there is already a widget in the widget section provided by woocomerce already.
I am very satisfied with the styling of it but i have some questions that i want to fix:
How do i add the widget to appear on all page just before the footer area?
How do i make that widget horizontal instead of vertical?
Thanks to whoever help me out !!!
You're going to have to insert the following into your footer.php file before the other div boxes start:
<div>
<?php
echo do_shortcode("[woocommerce_recently_viewed_products per_page='5']");
?>
</div>
Then we'll have to see what the styling looks like once that is in place.
First, install the plugin "Recently Viewed Products Shortcode"
then:
<div><?php echo do_shortcode("[woocommerce_recently_viewed_products per_page='5']"); ?></div>
'5' instead "5"

Customise the WooCommerce Product Widget

I need to redirect the user to a specific page by placing a hyperlink just before a closing </ul> tag (which is within a WordPress sidebar widget).
An example of what I am trying to achieve can be found below, using the WooCommerce Products widget which has been slightly modified to include an additional Specials hyperlink:
I am using the WooCommerce 2.9.1 plugin, and believe that the file I need to modify is the
class-widgets-products.php file. This file is made up with the following code - http://pastebin.com/vgpSqa6X.
On line 178 I have placed the following, which will display a hyperlink taking the user to a Specials page on the website:
echo '» Specials';
However, with this particular widget, it creates three separate instances and this will apply the hyperlink to All Products, Featured Products and On-sale Products.
How can I create separate hyperlinks that will apply to the widget, depending on which option has been selected in the admin menu?
For example, if the Featured Products option has been selected, it will output a Featured Products hyperlink at the bottom, and if the On-sale option has been selected, it will output a Specials hyperlink at the bottom.
Thank you.
The answer seems to lie in :
$this->settings->show->options
or :
$this->settings['show']['options']
...as the code you have pasted suggests.
Just evaluate this value with if's (or switches, whatever you feel comfortable with) :
if ($this->settings['show']['options'] == "this_particular_kind")
{
$link_at_the_bottom = '» This Particular Kind';
}
...

Categories