Skip to content

Instantly share code, notes, and snippets.

View gdnwebmedia's full-sized avatar

Robert Galofre gdnwebmedia

View GitHub Profile
@gdnwebmedia
gdnwebmedia / jquery-in-WordPress.php
Last active February 5, 2021 20:53
jQuery in WordPress
jQuery(document).ready(function( $ ) {
// your code here
});
@gdnwebmedia
gdnwebmedia / oxygen-post-content-truncating-and-revealing-content.php
Last active February 6, 2021 00:02
Truncating and revealing text – Adds a `Read More` and `Read less` patterns in a Single Page using Oxygen's Code Block
<!--
Truncating and revealing text – The Show More and Read More patterns
Customized by GDN from source https://justmarkup.com/articles/2017-01-12-truncating-and-revealing-text-the-show-more-and-read-more-patterns
-->
<!-- Add this to the Code Block > HTML Section -->
<article>
<?php
$content = get_the_content();
@gdnwebmedia
gdnwebmedia / oxygen-custom-taxonomies-without-links.php
Last active February 6, 2021 00:35
list the speakers without links
@gdnwebmedia
gdnwebmedia / oxygen-pods-gallery-loop.php
Last active February 17, 2021 15:38
Add Pods Admin based images in your template file
@gdnwebmedia
gdnwebmedia / forminator-send-tags-via-form.php
Last active February 18, 2021 22:49
Using the Mailchimp Integration already included in Forminator Pro. This scripts allows us to add one or multiple tags to a Forminator Pro form.
<?php
/*
Name: forminator-send-tags-via-form.php
Description: Sends Mailchimp Tags via Forminator Pro
Source: Konstantinos @
URL: https://premium.wpmudev.org/forums/topic/can-i-send-mailchimp-tags-via-form/#post-3624257
Using the Mailchimp Integration already included in Forminator Pro. This scripts allows us to add one or multiple tags to a Forminator Pro form.
install this code in the /mu-plugins folder
@gdnwebmedia
gdnwebmedia / retrieves-thumbnail-youtube.php
Last active February 26, 2021 04:30
Retrieves the thumbnail from a youtube or vimeo video
<?php
/**
* Retrieves the thumbnail from a youtube or vimeo video
* @param - $src: the url of the "player"
* @return - string
*
**/
function get_video_thumbnail( $src ) {
$url_pieces = explode('/', $src);
@gdnwebmedia
gdnwebmedia / wp-hide-related-videos-sitewide.php
Created March 4, 2021 14:57
Add modestbranding to WP Gutenberg Video Blocks
@gdnwebmedia
gdnwebmedia / wp-search-post-and-pages-only.php
Last active March 20, 2021 15:26
Search only WordPress Posts & pages
<?php
// Search only Posts or Pages
//Exclude pages from WordPress Search
function wpb_search_filter( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( 'post_type', [ 'post', 'page' ] );
}
}
@gdnwebmedia
gdnwebmedia / php-clean-wp_query-output.php
Created May 16, 2021 18:14
Readable version of wp_query output
printf( '<pre>%s</pre>', print_r( $wp_query, 1 ) );
@gdnwebmedia
gdnwebmedia / branda-custom-login-AbstractTag-customizations.css
Created May 27, 2021 13:36
Custom modifications to enhance Branda's AbstractTag Custom Login Template
html body {
display: flex;
align-items: stretch;
align-content: flex-start;
background-position: 200px 50%;
background-color: #ffffff;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;