Skip to content

Instantly share code, notes, and snippets.

View elpuas's full-sized avatar
💻
coding

Alfredo Navas-Fernandini elpuas

💻
coding
View GitHub Profile
@elpuas
elpuas / remove-custom-post-type-slug.php
Created September 30, 2017 15:47
Remove Custom Post Type Slug
/**
* Remove the slug from published post permalinks. Only affect our custom post type, though.
*/
function languagecorps_remove_cpt_slug( $post_link, $post, $leavename ) {
if ( 'countries' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
<style type="text/css">
.acf-map {
width: 100%;
height: 400px;
border: #ccc solid 1px;
margin: 20px 0;
}
/* fixes potential theme css conflict */
@elpuas
elpuas / device.css
Created November 20, 2017 20:36 — forked from jsoverson/device.css
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
<script type="text/javascript">
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
jQuery('body').css('width', '100vw');
jQuery('body').css('height', '100vh');
jQuery(document).ready(function() {
jQuery ( 'a.mini-icon-off' ).click(function() {
jQuery('body').css( 'overflow' , 'hidden');
console.log('click on button');
});
jQuery( '.cp-overlay-close img' ).click(function() {
@elpuas
elpuas / changeTableOrder.js
Created November 21, 2017 20:08
Change Table tr Order
// Change Table Order Mobile;
$('.table tbody').find('td').unwrap().wrap($('<tr/>'));
@elpuas
elpuas / detach.js
Created November 26, 2017 21:17
detach and append in DOM
if ($(document).find('.ssl-employee-post').lenght == 0 ) {
} else {
var sslCatTitle = $('.ssl-employee-post').detach();
$('.header-area .inner .header-content').append(sslCatTitle);
}
@elpuas
elpuas / add_script.php
Created January 5, 2018 17:41
Add Inline Script Into WP Footer
function print_my_inline_script_custom() {
echo '<script type="text/javascript">
// Document ready
jQuery(document).ready(function(){
alert("call");
});
</script>';
}
add_action( 'wp_footer', 'print_my_inline_script_custom' );
@elpuas
elpuas / ReadMe.md
Created January 16, 2018 21:53
ReadMe Template

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@elpuas
elpuas / equalHeight.js
Created February 1, 2018 18:11
Add equal height to columns
var whiteBackground = $('.mdo--servicesChild__js--selector');
if( whiteBackground.length > 0 ) {
// console.log('Si Existe');
// Select and loop the container element of the elements you want to equalise
whiteBackground.each(function(){
// Cache the highest
var highestBox = 0;
// Hide Admin Items
add_action('admin_head', 'mdo_adminizer');
function mdo_adminizer(){
global $current_user;
get_currentuserinfo();
if ( $current_user->user_email !== "[email protected]" ) {
echo '<style>