Skip to content

Instantly share code, notes, and snippets.

View vbaimas's full-sized avatar
🎯
Focusing

Vasilis Baimas vbaimas

🎯
Focusing
View GitHub Profile
@vbaimas
vbaimas / _spacing-helpers.scss
Created August 17, 2017 22:04 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@vbaimas
vbaimas / functions.php
Last active July 1, 2018 23:40
Testimonials Carousel in WordPress using Custom Post Types, Advanced Custom Fields and Slick Carousel jQuery.
<?php
// Register Custom Post Type
function quote() {
$labels = array(
'name' => _x( 'quote', 'Post Type General Name', 'quote' ),
'singular_name' => _x( 'quote', 'Post Type Singular Name', 'quote' ),
'menu_name' => __( 'Quote', 'quote' ),
'name_admin_bar' => __( 'Quote', 'quote' ),
'archives' => __( 'Item Archives', 'quote' ),
@vbaimas
vbaimas / functions.php
Last active July 1, 2018 23:39
Clients Carousel in WordPress using Custom Post Types, Advanced Custom Fields and Flexslider.
// Register Custom Post Type
function partner() {
$labels = array(
'name' => _x( 'partner', 'Post Type General Name', 'partner' ),
'singular_name' => _x( 'partner', 'Post Type Singular Name', 'partner' ),
'menu_name' => __( 'Partner', 'partner' ),
'name_admin_bar' => __( 'Partners', 'partner' ),
'archives' => __( 'Item Archives', 'partner' ),
'attributes' => __( 'Item Attributes', 'partner' ),
@vbaimas
vbaimas / functions.php
Last active July 1, 2018 23:39
Create a full width attachment image in WordPress using Custom Post Types and Advanced Custom Fields
add_action( 'after_setup_theme', 'setup' );
function setup() {
add_theme_support( 'post-thumbnails' ); // This feature enables post-thumbnail support for a theme
add_image_size( 'single-workspace', 9999, 840, false );
}
@vbaimas
vbaimas / sass-margin-padding.scss
Last active August 27, 2018 18:44 — forked from jbrz0/sass-margin-padding.scss
Sass mixin for quickly adding padding and margins
//Padding mixin
@mixin padding($top, $right, $bottom, $left) {
padding-top: $top;
padding-right: $right;
padding-bottom: $bottom;
padding-left: $left;
}
//Margin mixin
@mixin margin($top, $right, $bottom, $left) {
margin-top: $top;
@vbaimas
vbaimas / _mixins.scss
Created August 27, 2018 19:39 — forked from garyharan/_mixins.scss
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@vbaimas
vbaimas / Changing the search string in WordPress search form
Last active January 4, 2019 16:12
In case you want to change the default word “Search” in the Search Button, into something different, this snippet will allow to change it.
/*/
/* Change Search Button Text
/*/
add_filter('get_search_form', 'my_search_form');
function my_search_form($text) {
$text = str_replace('value="Search"', 'value="ok"', $text); //set as value the text you want
return $text;
}
@vbaimas
vbaimas / Retrieve the permalink for a page by name
Last active September 18, 2019 10:22
Scenario : You would normally grab a page link via its ID but in the case that you had a localhost which install and an online install the ID was different, how you can link the page? Solution 2 : Retrieve the permalink for a page by name
@vbaimas
vbaimas / Retrieve the permalink for a page by title
Created September 18, 2019 10:20
Scenario : You would normally grab a page link via its ID but in the case that you had a localhost which install and an online install the ID was different, how you can link the page? Solution 2 : Retrieve the permalink for a page by title
@vbaimas
vbaimas / Retrieve the permalink for a page by slug
Created September 18, 2019 10:26
Scenario : You would normally grab a page link via its ID but in the case that you had a localhost which install and an online install the ID was different, how you can link the page? Solutions 3: Retrieve the permalink for a page by slug