Category: Custom Code

With 208 articles also related to:

Aleš Sýkora wrote:

Swiper: Prevent single slide swipe with loop enabled

December 16, 2022 in Custom Code, WordPress

If you want to use Swiper slider and you have a situation where you want to disable sliding if there is only one slide, but use infinite loop when there is more than one slide, you cannot achieve it only with Swiper settings. It looks like you can with watchOverflow:true and loop:true… But those two…

Continue reading

Aleš Sýkora wrote:

How to hide elements when pagination is active in WordPress

November 28, 2023 in Custom Code, WordPress

Hide elements on pagination pages but display them on first archive page. Easily with 3 lines of CSS.

Continue reading

Aleš Sýkora wrote:

Sticky shrinking header in Oxygen Builder

November 28, 2023 in Custom Code, Oxygen Builder, Plugins, WordPress

How to create a sticky header with section element and make it sticky and shrinking (height changing)?

Continue reading

Aleš Sýkora wrote:

Set Tabs to closed on page load in Oxygen Builder

November 28, 2023 in Custom Code, Oxygen Builder, Plugins, WordPress

If you want to bypass the default state of tabs in Oxygen which is – first tab opened by default, then you need to use some jQuery. Don’t forget to change the .class-of-your-tabs-element and oxy-tabs-active-tab-class to your classes. You will find them with site inspector in browser.

Continue reading

Aleš Sýkora wrote:

Enable WordPress Theme when using Oxygen Builder

November 28, 2023 in Custom Code, Gutenberg, Oxygen Builder, Plugins, WordPress

I found this 3 remove filter functions very useful, when you need to use the theme.json and other files to customize the Gutenberg blocks and still use the Oxygen Builder. I just put these lines in code snippets plugin and activate. My option for code snippets plugin is Advanced scripts. You can customize Gutenberg in…

Continue reading

Aleš Sýkora wrote:

ACF Local JSON with Oxygen Builder

November 28, 2023 in ACF, Custom Code, Oxygen Builder, Plugins, WordPress

Would you like to speed up your page? If you use Advanced Custom Fields plguin, you may try the local JSON. Local JSON is a new feature added in version 5 which saves field group and field settings as .json files within your theme. The idea is similar to caching, and both dramatically speeds up…

Continue reading

Aleš Sýkora wrote:

How to use multiple Swiper.js sliders with same settings on one page

November 28, 2023 in Custom Code, WordPress

If you need to use one slider with same settings on one page multiple times, you don’t need to create a JavaScript for each slider. For example, I use multiple video sliders. Their content takes from the ACF repeater: You can use one code to initiate all sliders. You don’t need to add special classes…

Continue reading

Aleš Sýkora wrote:

Change youtube to youtube-nocookie with ACF embed field

November 28, 2023 in ACF, Custom Code, Plugins, WordPress

With Cookie and GDPR laws, you should display the YouTube and other embeds only after user consent to marketing cookies. There is a way to avoid this but still send user IP address to YouTube and store one cookie instead of multiple ones. The way is a change of YouTube Embed URL to “youtube-nocookie.com” .…

Continue reading

Aleš Sýkora wrote:

Use first ACF Gallery image as Featured image of Custom post type single

January 9, 2024 in ACF, Custom Code, Plugins, WordPress

How do I set the first gallery image from a custom post type gallery field as the featured image? Found this here: Use first image from gallery of custom post type to set featured image – ACF Support (advancedcustomfields.com) It use ACF | acf/save_post (advancedcustomfields.com) filter to apply. Regenerate all posts to set the featured…

Continue reading

Aleš Sýkora wrote:

Change Gutenberg Color Pallete to your own

November 28, 2023 in Custom Code, Gutenberg, Plugins, WordPress

If you want to have your theme colors in Gutenberg instead of all colors use this code. You can also disable gradients in Gutenberg editor. Add this code to your functions.php or custom plugin or code snippets plugin like Advanced scripts. Add more colors if you want :-) just change the name (Zelená,Modrá…). You also…

Continue reading