Skip to content

Instantly share code, notes, and snippets.

View vicso-name's full-sized avatar
🦖
I may be slow to respond.

Victor vicso-name

🦖
I may be slow to respond.
View GitHub Profile
@vicso-name
vicso-name / hiding-content-outlook-webmail.html
Created November 27, 2022 21:06 — forked from jamesmacwhite/hiding-content-outlook-webmail.html
Hiding content with mso-hide:all; to be more friendly with Outlook.com
<!--
Example 1: Using IF ELSE logic
Works with Outlook (Desktop)?: Yes
Works with Outlook.com?: No
When using IF ELSE logic, Outlook.com will remove content in both conditionals, which is problematic.
-->
<!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
@vicso-name
vicso-name / JS.js
Created November 1, 2021 20:21
Create AJAX WordPress Search
$("input#keyword").keyup(function() {
if ($(this).val().length > 2) {
$("#datafetch").show();
} else {
$("#datafetch").hide();
}
});
$('#search_submit').on('click',function(){
let searcher = $('#searcher_form');
@vicso-name
vicso-name / Register menu and show in theme.php
Created October 24, 2021 06:01
register_nav_menus() This function automatically registers custom menu support for the theme
<?
register_nav_menus( $locations = array() );
// $locations Associative array of menu location identifiers (like a slug) and descriptive text.
register_nav_menus( array(
'header_menu' => 'Main menu',
'footer_menu' => 'Footer menu'
) );
@vicso-name
vicso-name / Get terms data.php
Created October 19, 2021 07:42
How to get terms title and link to the term. This method also works for custom taxonomy.
<?php
$terms = get_the_terms( $current_post_id, 'products' );
foreach($terms as $term) {
$term_title = $term->name;
$term_link = get_term_link($term);
}
?>
@vicso-name
vicso-name / file-upload.css
Created February 6, 2021 20:18 — forked from gdarko/file-upload.css
WordPress Custom Profile Image Ajax Upload
.upload-thumb {
display: inline-block;
width: 120px;
height: 120px;
overflow: hidden;
background: #e2e2e2;
border: 1px solid #cdcdcd;
line-height: 120px;
margin-bottom: 10px;
}
@vicso-name
vicso-name / example-ajax-enqueue.php
Created September 10, 2020 16:32 — forked from Gori4ka/example-ajax-enqueue.php
Simple WordPress Ajax Example
<?php
function example_ajax_enqueue() {
// Enqueue javascript on the frontend.
wp_enqueue_script(
'example-ajax-script',
get_template_directory_uri() . '/js/simple-ajax-example.js',
array('jquery','wp-util')
);
@vicso-name
vicso-name / gist:5973e553cb9e25955c6d25640cf31e30
Created October 28, 2019 09:16 — forked from ivandoric/gist:e4e46294c4d35eac0ec8
wordpress: create custom reset password page
<?php //Add all of this tu custom page template ?>
<?php
global $wpdb;
$error = '';
$success = '';
// check if we're in reset form
if( isset( $_POST['action'] ) && 'reset' == $_POST['action'] )
{
@vicso-name
vicso-name / testimonial_carousel.php
Created November 26, 2017 18:18 — forked from morgyface/testimonial_carousel.php
Testimonial carousel | Wordpress | ACF | Bootstrap