Skip to content

Instantly share code, notes, and snippets.

View webbouwer's full-sized avatar
💫
Contact me by email

Webbouwer webbouwer

💫
Contact me by email
View GitHub Profile
[
{
"name": "Versio",
"website": "https://versio.nl",
"portal": "https://mijn.versio.nl",
"hostcontrol": "directadmin",
"status": {
"value": 1,
"link": "https://www.versio.eu/status",
"rss": "https://www.versio.eu/rss/maintenance",
@webbouwer
webbouwer / early_post_publish.php
Last active October 14, 2021 08:14
WP posts published with future date
<?php
/*
* in default loops using hooks
* https://developer.wordpress.org/reference/functions/_future_post_hook/
*/
function publish_futuredate_post( $post_data ) {
if ( $post_data['post_status'] == 'future' && $post_data['post_type'] == 'post' )#Here I am checking post_type='post' , you may use different post type and if you want it for all post type then remove "&amp;&amp; $post_data['post_type'] == 'post'"
{
$post_data['post_status'] = 'publish';
}
@webbouwer
webbouwer / add_overlay.css
Last active August 28, 2021 15:29
Divi Image/Portfolio Gallery Overlay Display
/* Divi portfolio projects by category - gallery thumb image title text overlay */
/* 1. Add 'ds-hover-gallery' class to Divi portfolio gallery in page or post */
/* 2. Adjust gallery overlay zoom-icon-color and hover-overlay-color to 0 alpha */
/* 3. Add js and css code in Divi > Integration tab > head code */
/* portfolio (project) galleries */
.ds-hover-gallery .et_pb_portfolio_item {
position: relative;
}
.ds-hover-gallery .et_pb_module_header {
@webbouwer
webbouwer / get_image_orientation.php
Last active October 14, 2021 08:37
Image orientation in php or javascript[jquery]
<script>
function setImagesOrient(){
var pics = $('body').find("img");
for (i = 0; i < pics.length; i++) {
pics[i].addEventListener("load", function() {
if (this.naturalHeight > this.naturalWidth) {
this.classList.add("portrait")
} else {
this.classList.add("landscape")
@webbouwer
webbouwer / hide-topmenu-on-scroll
Created April 30, 2021 16:01
Hide Divi Second Menu onscroll
/* hide top header on scroll */
#top-header {
z-index: 9;}
#main-header{
transition: 0.5s;
-moz-transition: 0.5s;
-webkit-transition: 0.5s;}
#main-header.et-fixed-header {
top: 0 !important;}
@webbouwer
webbouwer / woocommerce_cf.php
Last active March 6, 2021 17:22
wp theme woocommerce.php content functions dump
<?php // wp theme woocommerce.php content functions dump
/*
$all_products = get_posts( array(
'post_type' => 'product',
'numberposts' => -1,
'post_status' => 'publish',
'fields' => 'ids',
) );
@webbouwer
webbouwer / iframe_touchscreen_emulator.css
Last active April 30, 2021 16:02
Iframe touchscreen emulator style
/* iframe responsive display */
.frame-container {
background-color: #b5bdc8;
padding: 12px 8px 32px;
font-size: 25px;
text-align: center;
transition: all 0.2s;
margin: 0 auto;
width: 90%;
-webkit-border-radius: 15px;
@webbouwer
webbouwer / divi_tabs_vertical_style.css
Last active April 30, 2021 16:03
Divi Tabs Styling Vertical
/* Divi Vertical Tabs 1
* Original code from https://diviextended.com/how-to-create-divi-vertical-tabs/
*/
.vertical-tabs1 {
border: none;
}
.vertical-tabs1 ul.et_pb_tabs_controls {
float: left;
@webbouwer
webbouwer / divi_menu_styling_submenu.css
Last active April 30, 2021 16:04
Remove arrows and style submenu's
/* Remove arrows and style submenu's */
#top-menu > li
{
padding-bottom:0px;
font-weight:100;
}
#top-menu > li ul.sub-menu a
{
font-size:1.2em !important;
}
@webbouwer
webbouwer / Change-add-to-cart-text.php
Last active April 30, 2021 17:33
Change add to cart text (functions.php) for Wordpress Woocommerce/Divi
<?php
/* Common used php (functions.php) for Wordpress Divi / Woocommerce Theme */
// Woo cart & button adjustments
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Add to bag', 'woocommerce' );
}