Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
@dexit
dexit / functions.php
Created July 25, 2025 10:11 — forked from cvl01/functions.php
Remove Elementor Pro search box settings query param
<?php
add_action('elementor_pro/search/before_input', function ($module) {
$module->remove_render_attribute('widget_props', 'name');
$module->remove_render_attribute('widget_props', 'value');
});
@dexit
dexit / custom.js
Created July 25, 2025 10:09 — forked from hmowais/custom.js
Add Sticky Header class in Elementor
jQuery( document ).ready(function($) {
jQuery(window).scroll(function($){
if ($(this).scrollTop() > 80) {
$('header.elementor-section').addClass('StickyHeader');
} else {
$('header.elementor-section').removeClass('StickyHeader');
}
});
});
@dexit
dexit / functions.php
Created July 25, 2025 10:08 — forked from hmowais/functions.php
Multiple Featured Images
<?php
// http://lifeonlars.com/wordpress/how-to-add-multiple-featured-images-in-wordpress/
// https://wp-qa.com/how-to-add-multiple-featured-image-upload-button-without-plugin-for-wordpress
// add these code in functions.php after add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-thumbnails' );
add_image_size( 'case-image', 1371, 893, true );
add_image_size( 'ipad-image', 2383, 1867, true );
add_image_size( 'feature-image', 960, 500, true );
@dexit
dexit / functions.php
Created July 25, 2025 10:08 — forked from hmowais/functions.php
Add Taxonomy Image to Custom Post Type
<?php
//Add image field in taxonomy page
add_action( 'our_portfolio_category_add_form_fields', 'add_custom_taxonomy_image', 10, 2 );
function add_custom_taxonomy_image ( $taxonomy ) {
?>
<div class="form-field term-group">
<label for="image_id"><?php _e('Image', 'taxt-domain'); ?></label>
<input type="hidden" id="image_id" name="image_id" class="custom_media_url" value="">
@dexit
dexit / custom.js
Created July 25, 2025 10:08 — forked from hmowais/custom.js
Add Class in Section on Scroll
jQuery( document ).ready(function($) {
var sections = $('.animateiT'),
nav = $('.jump-left'),
nav_height = nav.outerHeight();
$(window).on('scroll', function() {
var cur_pos = $(this).scrollTop();
sections.each(function() {
var top = $(this).offset().top - 300;
var bottom = top + $(this).outerHeight();
if (cur_pos >= top && cur_pos <= bottom) {
@dexit
dexit / functions.php
Created July 25, 2025 10:08 — forked from hmowais/functions.php
Post Sync to other website with REST API
<?php
// Website 1
/* API for Post Sync */
function send_post_to_campus($post_id) {
if (wp_is_post_revision($post_id)) {
error_log('Skipping post revision ID: ' . $post_id);
return;
@dexit
dexit / functions.php
Created July 25, 2025 10:08 — forked from hmowais/functions.php
CPT + Taxonomies Updated
<?php
<?php
/* Register CPT */
function cwptheme_post_type() {
$post_types_arr = array( 'Slider', 'Work', 'Staff', 'Map', 'Careers', 'Media', 'Events', 'Litigation', 'Advocacy', 'Guides' );
foreach( $post_types_arr as $post_type_a){
@dexit
dexit / functions.php
Created July 25, 2025 10:07 — forked from hmowais/functions.php
Close Elementor Popup and Scroll to Specific Section on button click
<?php
function cs_footer() { ?>
<script>
jQuery(function($){
$(document).on('click','.elementor-location-popup a', function(event){
elementorProFrontend.modules.popup.closePopup( {}, event);
});
});
</script>
@dexit
dexit / skills_assessment_schema.sql
Created July 24, 2025 21:16
skills_assessment_schema
-- skills_assessment_schema.sql
-- Use the database
--CREATE DATABASE IF NOT EXISTS skills_assessment;
--USE skills_assessment;
-- Table for storing local user information
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
idUserInstitution VARCHAR(255) UNIQUE, -- Assuming this is unique per institution
idUser VARCHAR(255) UNIQUE, -- Assuming this is globally unique
@dexit
dexit / process_opportunity2.php
Created July 24, 2025 21:16
process_opportunity.php
<?php
// process_opportunity.php (or your chosen script name for this specific workflow)
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL); // Use E_ALL for comprehensive error reporting
// Adjust paths as necessary based on your project structure
require_once __DIR__ . '/../vendor/autoload.php';
require_once './ApiClient/BaseApiClient.php';