Skip to content

Instantly share code, notes, and snippets.

View jamesfosker's full-sized avatar
💭
Busy updating my plugins for the WordPress community

James Fosker jamesfosker

💭
Busy updating my plugins for the WordPress community
View GitHub Profile
@jamesfosker
jamesfosker / functions.php
Last active July 5, 2021 12:38
Company Age shortcake
<?php
function companyage(){
$currentyear = date("Y");
$foundedyear = '1979'; //change year to your own year
$companyage = $currentyear - $foundedyear;
return = $companyage;
}
add_shortcode('mycompanyage', 'companyage');
// use [mycompanyage] to output the business age in years
function custom_divi_header() {
//Insert HTML here
}
add_action( 'et_html_main_header', 'custom_divi_header' );
@jamesfosker
jamesfosker / scrollable-divi-mobile-menu.css
Created April 5, 2018 17:51 — forked from hbaker/scrollable-divi-mobile-menu.css
Divi Theme - Make Divi's Mobile Menu Scrollable
.et_mobile_menu {
overflow-y:scroll!important;
max-height:80vh!important;
-overflow-scrolling:touch!important;
-webkit-overflow-scrolling:touch!important;
}
@jamesfosker
jamesfosker / functions.php
Last active November 5, 2021 02:36
Change the slugs of project post, project category and project tags, add this to your child theme functions.php, once you've changed the slug on line 5, 20 & 38, go to your dashboard and go setting/permalinks and just hit the save button to update the slugs
/*Change Project Post Type Slug*/
function ds_divi_modify_project_post_slug() {
return array(
'feeds' => true,
'slug' => 'new-slug', /*Change text between brackets*/
'with_front' => false,
);
}
add_filter( 'et_project_posttype_rewrite_args', 'ds_divi_modify_project_post_slug' );