Skip to content

Instantly share code, notes, and snippets.

View Lonsdale201's full-sized avatar

Soczó Lonsdale201

View GitHub Profile
@Lonsdale201
Lonsdale201 / code
Last active May 31, 2024 12:55
JetEngine - Dynamic visibility - Is Front Page
// place the code in the child theme functions.php or a custom code snippets plugin.
// Best usage in the Listing Grid
// Open an widget, dynamic visibility, and search the Is Front page visibility under the Custom category.
add_action( 'jet-engine/modules/dynamic-visibility/conditions/register', function( $conditions_manager ) {
class Is_Front_Page_Condition extends \Jet_Engine\Modules\Dynamic_Visibility\Conditions\Base {
public function get_id() {
return 'is-front-page';
@Lonsdale201
Lonsdale201 / code
Created May 28, 2024 09:30
JetEngine Custom macro - Empty terms
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Terms Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Empty terms option, and select whitch terms want to use
add_action( 'jet-engine/register-macros', function() {
class Empty_Terms_Macro extends \Jet_Engine_Base_Macros {
@Lonsdale201
Lonsdale201 / code
Last active May 27, 2024 14:09
JetEngine - Data Store - Store item on view - Update custom meta
// This code monitors a given data store type (Store item on view),
// and updates and replaces it with the value stored in the store in a given meta (number based) programmed way.
// It's ideal if you want to count the number of times a post has been viewed, and want to continuously transfer the value to a meta
// (so you can do a popular sorting filter, for example)
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Data store - enable the "Count Items", and "Store item" on view option, and choose post type
// Create a number type meta (jetengine, or other plugins, or php)
// In the Number meta, recommended to set a default 0 value
// replace the "megtekintes" with your data store SLUG (you need to replace in two places top of the code, and bottom of the code !!)
@Lonsdale201
Lonsdale201 / szechenyicode
Created May 26, 2024 21:10
Széchenyi logo + Toggle funkció
// másold be a kódot egy snippet tárolására alkalmas bővítménybe.
// FluentSnippets esetében válaszd a Content (php + html) opciót és a teljes kódot másold be , hogy hol fusson "Where to run" válaszd a "Site Wide Footer" opciót
// cseréld ki a képet, a saját weboldaladra feltöltött médiatáras kép linkjével
// ezt cseréld ki a kódban: "<img id="fixedImage" src="http://sajatweboldalam.hu/wp-content/uploads/2024/05/infoblokk-jobb-also-sarokban.png" alt="Szechenyi logo">"
// a kód alsó részében (script részben) van egy átirányítási opció ha a képre kattintanak, kommenteld ki, vagy töröld ha nincs rá szükséged.
// localstorage ba tárolja a kód, ha el van rejtve, vagy nincs a logó, így nem nyitja ki minden oldal újratöltődéskor.
<div id="imageContainer">
<button id="toggleButton">
<svg id="chevronIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-up">
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:23
JetEngine Custom macro - Fluent CRM get Contact users with selectable contact type
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM Users with Contact Type
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// In addition, you can select which Contact type you want to retrieve users from.
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:21
JetEngine Custom macro - Fluent CRM get Contact users with selectable list
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM Users with List
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// You can also select which CRM list you want to retrieve the users from
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:20
JetEngine Custom macro - Fluent CRM get Contact users with selectable status
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM Users with Status
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// In addition you can select which subscription state you want to retrieve users from, you can retrieve users from all default states.
@Lonsdale201
Lonsdale201 / code
Created May 21, 2024 20:17
JetEngine Custom macro - Fluent CRM get Contact users
// place the code in the child theme functions.php or a custom code snippets plugin like FluentSnippets
// how to use
// Create a new Users Query in the Query builder
// Go to the Include/Exclude section
// click the Include section dynamic icon and choose the Fluent CRM / WP Users macro
// HELP IMAGE https://prnt.sc/06FFNY9E24Sg
// This macro returns the identifiers of users who can be found in fluentCRM as both contacts and wordpress users.
// It will not return users who are not registered on your WordPress site. The subscription status is independent for this macro.
@Lonsdale201
Lonsdale201 / code
Created May 12, 2024 07:36
JetEngine - Calculated callback - Age calc
// This code uses the date meta to calculate how many years old. The calculation is done using
// the year from the given meta and the current date. The returned number simply returns the years.
// Can also be used with user listings.
// Ideally, the user should be able to specify when they were born, so that you can use the
// calculation to return how old they are at the moment.
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
@Lonsdale201
Lonsdale201 / code
Created May 9, 2024 08:24
JetEngine - Calculated callback - Calculate Hours and Minutes
// This code can convert the number values to Hours, and minutes.
// Example, your meta store: "125" this calc can output to: 2h5m so 2 hours, and 5 minutes
// copy this code in the child theme functions.php or a specific code plugin like FluentSnippets
// For the code to work, you need to install the Calculated Callback Add-on addons
// Plugin: https://github.com/MjHead/jet-engine-calculated-callback
// Plugin desc: https://crocoblock.com/knowledge-base/jetengine/calculated-callback-add-on/#custom-callback
// when you pasted the code, open the Elementor editor, and place the Dynamic Field widget, enable the Filter Field output
// in the dropdown, select the Calculated field Callback