Vajna Botond

Designer

Access data from another WordPress database

To retrieve data from a different database within WordPress, you must create a custom query utilizing the $wpdb class. This class facilitates interaction with multiple databases in the WordPress environment. Below is an illustration of how you can retrieve information from the wp_posts and wp_postmeta tables in another database: Subsequently, you can utilize the $posts… Read More ›

Woocommerce product gallery opacity issue

Issue: In single-product.php when using the_content(); the woocommerce-product-gallery div have the opacity set to: 0. Solving: reference:

Enable Gutenberg editor in WooCommerce

How to get WooCommerce products grouped by their categories?

Create files in wp theme editor

In WP theme editor open functions.php, and add the following code and replace my-file.php with your file name. source:https://chap.website/creating-new-files-in-the-wordpress-theme-editor/

Custom block editor styles

Theme Support

Get woocommerce product gallery images

source:https://gist.github.com/Niloys7/17b88d36c1c38844a6cf2127c15dee63

CSS background opacity with rgba in IE 8

RGBA background in IE. does not work, but you can use a gradient filter, with the same start and end color as in the example below

Create WordPress custom hooks

When I create custom WordPress themes speed is a must. thaht`s one thing why you need custom themes, ready made themes have a lots of code you do not need in your site, and they are just slowing down your page load. For instance by avoiding the use of wp_head(); or/and wp_footer(); you can significantly… Read More ›

Auto format text

wpautop(); replace double line breaks with HTML paragraph tags. source: https://developer.wordpress.org/reference/functions/wpautop/

How to add read more link to your WordPress excerpt?

By default WordPress function the_excerpt(); does not display a read more link.To display link to post after the excerpt you must filter the excerpt_more. You can replace the Read More &raquo text with anything you like.

WordPress image sizes

WordPress automatically generate some images on upload so when you upload one image by default there will be 5, or more variants of the same image with different sizes. You may not need all these image sizes, an they are just using space on the server. this can be annoying if you are short on… Read More ›

Remove -scaled image

– Scaled image is the image WordPress generates when generating thumbnails, this is the maximum image size, and it`s not removable by the default remove_image_size(); or unset(); To remove it, add this filter to functions.php

Show which template is used

Sometimes when we want to know what template a page uses, specially when working with themes that we are not used to it. The following script will show the path to the current template in the footer if admin user is logged in, paste it in functions.php As you can see, it is hooked to… Read More ›