This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get all image sizes. | |
*/ | |
function cp_get_all_image_sizes() { | |
global $_wp_additional_image_sizes; | |
print '<pre>'; | |
print_r( $_wp_additional_image_sizes ); | |
print '</pre>'; | |
} | |
add_action( 'init', 'cp_get_all_image_sizes' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove extra image sizes | |
* | |
* @param array $sizes Array of image sizes. | |
*/ | |
function cpdivi_remove_extra_image_sizes( $sizes ) { | |
unset( $sizes['et-pb-post-main-image'] ); | |
unset( $sizes['et-pb-post-main-image-fullwidth'] ); | |
unset( $sizes['et-pb-portfolio-image'] ); | |
unset( $sizes['et-pb-portfolio-module-image'] ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main-header #et-top-navigation { | |
float: none; | |
padding: 0; | |
} | |
#top-menu-nav { | |
display: none; | |
} | |
#et_mobile_nav_menu { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add Favicon | |
*/ | |
function cpdivi_custom_favicon() { | |
$favicon_path = get_stylesheet_directory_uri() . '/img/favicon/'; | |
ob_start(); | |
?> | |
<link rel="shortcut icon" href="<?php echo esc_attr( $favicon_path ); ?>favicon.ico" /> | |
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="<?php echo esc_attr( $favicon_path ); ?>apple-touch-icon-57x57.png" /> | |
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo esc_attr( $favicon_path ); ?>apple-touch-icon-114x114.png" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//shortcode related products | |
add_shortcode('related_products','rel_prod'); | |
function rel_prod(){ | |
global $post; | |
ob_start(); | |
?> | |
<div class="section section-post-related"> | |
<div class="section_wrapper clearfix"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Shortcode for posts | |
* | |
* @package Divi | |
*/ | |
$posts_args = array( | |
'post_type' => 'post', | |
'posts_per_page' => '3', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove portfolio post type from theme | |
* | |
* @param array $args post type array. | |
*/ | |
function cpdivi_et_project_posttype_args( $args ) { | |
return array_merge( | |
$args, | |
array( | |
'public' => false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return title based on current page, post, taxonomy, post type, category, tag etc. | |
*/ | |
function cpdivi_title() { | |
if ( is_home() ) { | |
$page_for_posts = get_option( 'page_for_posts' ); | |
$title = sprintf( __( '%s', 'cpdivi' ), get_the_title( $page_for_posts ) ); | |
} elseif ( is_category() ) { | |
/* translators: 1: category title. */ | |
$title = sprintf( __( 'Category: %s', 'cpdivi' ), single_cat_title( '', false ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CSS rules for WordPress Login page. | |
* | |
* @package ChetanP | |
*/ | |
/** | |
* CSS for wp-login.php page | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect non-www URLs to www with https | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] |
NewerOlder