Skip to content

Instantly share code, notes, and snippets.

@CoachBirgit
CoachBirgit / wp-api-custom-taxonomies.php
Created October 28, 2015 05:39 — forked from scottopolis/wp-api-custom-taxonomies.php
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
@CoachBirgit
CoachBirgit / vagrant-cheat-sheet.md
Last active October 28, 2015 10:21 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@CoachBirgit
CoachBirgit / divi-nav-absolute-positioning.css
Last active November 5, 2015 07:13
DIVI: NAV - ABSOLUTE POSITIONING
/*DIVI NAV - ABSOLUTE POSITIONING*/
#main-header{
position:absolute;
}
.et-fixed-header{
top: 0;
background-color: #fff;
position: absolute; width: 100%;
@CoachBirgit
CoachBirgit / divi-cta-buttons-outline-style.css
Created November 5, 2015 07:14
DIVI: CTA BUTTONS - OUTLINE STYLE
/*DIVI CTA BUTTONS - OUTLINE STYLE*/
.et_pb_bg_layout_light .et_pb_promo_button, .et_pb_bg_layout_light .et_pb_more_button, .et_pb_bg_layout_light .et_pb_newsletter_button, .et_pb_pricing_table_button {
background-color: rgba(255, 255, 255, 0) !important;
color: #82c0c7;
border-color: #82c0c7;
}
.et_pb_promo_button, .et_pb_newsletter_button, a.et_pb_more_button, .et_pb_pricing_table_button {
@CoachBirgit
CoachBirgit / divi-cta-buttons-squared-corners.css
Created November 5, 2015 07:15
DIVI: CTA BUTTONS - SQUARED CORNERS
/*DIVI CTA BUTTONS - SQUARED CORNERS*/
.et_pb_promo_button, .et_pb_newsletter_button, a.et_pb_more_button, .et_pb_pricing_table_button {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
/* source: http://www.elegantthemes.com/blog/resources/divi-css-tricks */
@CoachBirgit
CoachBirgit / divi-cta-buttons-opacity-hover.css
Created November 5, 2015 07:17
DIVI: CTA BUTTONS - 50% Opacity Hover State
/*DIVI CTA BUTTONS - HOVER*/
.et_pb_promo_button, .et_pb_newsletter_button, a.et_pb_more_button, .et_pb_pricing_table_button {
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.et_pb_promo_button:hover, .et_pb_newsletter_button:hover, a.et_pb_more_button:hover, .et_pb_pricing_table_button:hover {
opacity:.75;
@CoachBirgit
CoachBirgit / divi-menu-darker.css
Created November 5, 2015 07:18
DIVI: make menu darker
/* DIVI: make menu darker */
#top-menu a, .et_mobile_menu a, #et_search_icon:before {
color: #ddd !important;
}
#top-menu a:hover, .et_mobile_menu a:hover {
color: #fff !important;
}
.nav ul li a:hover, .et_mobile_menu li a:hover { color: #111; background-color: #2b2b2b; }
@CoachBirgit
CoachBirgit / divi-rounded-corners-all-modules.css
Created November 5, 2015 07:20
DIVI: ROUNDED CORNERS - ALL MODULES
/*DIVI ROUNDED CORNERS - ALL MODULES*/
@media only screen and ( min-width:768px) and (max-width: 980px ) {
.et_pb_featured_table:nth-child(3), .et_pb_featured_table:nth-child(4){margin-top: 30px;}
.et_pb_pricing_table:nth-child(odd){
-webkit-border-top-left-radius:6px;
-webkit-border-bottom-left-radius:6px;
-moz-border-radius-topleft:6px;
-moz-border-radius-bottomleft:6px;
@CoachBirgit
CoachBirgit / divi-post-types-gray-scale-hover-effect.css
Created November 5, 2015 07:21
DIVI: POST, PROJECTS, and PRODUCTS - B&W HOVER STATE
/*DIVI POST, PROJECTS, and PRODUCTS - B&W HOVER STATE*/
.et_shop_image:hover, .et_portfolio_image:hover, .et_pb_post img:hover {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
filter: grayscale(100%);
}
.et_pb_post img{-moz-transition: all 0.3s; -webkit-transition: all 0.3s; transition: all 0.3s}
@CoachBirgit
CoachBirgit / divi-lightbox-snippet-for-functions.php
Last active January 19, 2022 06:33
DIVI: add lightbox to regular content images
/* --- DEPRECATED --- */
/* add .et_pb_lightbox_image clss to content images */
add_filter('the_content', 'divi_add_lightbox');
function divi_add_lightbox($content) {
global $post;
$pattern ="/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
$replacement = '<a$1href=$2$3.$4$5 class="et_pb_lightbox_image" title="'.$post->post_title.'"$6>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}