This file contains 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_shortcode('sg_whitepaper_list', 'sgWhitepaperListFunction'); | |
function sgWhitepaperListFunction(){ | |
$h = '<article class="whitepapers-list">'; | |
$loop = new WP_Query( array( | |
'post_type' => 'whitepaper', | |
'posts_per_page' => -1 | |
) | |
); |
This file contains 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
function my_shortcode_function() { | |
return '<p>This is generated by my shortcode</p>'; | |
} | |
add_shortcode( 'my_shortcode', 'my_shortcode_function' ); | |
// enter the shortcode [my_shortcode] to your page/post content and the page/post will display "This is generated by my content" in <p> tags | |
function my_content_shortcode_function( $atts, $content = null ) { |
This file contains 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 | |
get_header(); | |
$show_default_title = get_post_meta( get_the_ID(), '_et_pb_show_title', true ); | |
$is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() ); | |
?> |
This file contains 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 get_header(); ?> | |
<div id="main-content"> | |
<div class="container"> | |
<div id="content-area" class="clearfix"> | |
<div id="left-area"> | |
<?php | |
if ( have_posts() ) : | |
while ( have_posts() ) : the_post(); | |
$post_format = et_pb_post_format(); ?> |
This file contains 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 | |
/* | |
Template Name: Restricted Page | |
*/ | |
get_header(); | |
$is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() ); |
This file contains 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 | |
$args = array( | |
'post_type' => 'business', | |
'posts_per_page' => -1, | |
); | |
$business_query = new WP_Query($args); | |
$location_record = array(); | |
$categories = array(); | |
if ( $business_query->have_posts() ) : while ( $business_query->have_posts() ) : $business_query->the_post(); | |
$the_ID = get_the_ID(); //echo '<pre>'.$the_ID.'</pre>'; |
This file contains 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_filter( 'body_class', 'et_divi_sidebar_class' ); | |
function override_divi_sidebar_class( $classes ) { | |
// Set Woo shop and taxonomies layout. | |
if ( class_exists( 'woocommerce' ) && ( is_woocommerce() && ( is_shop() || is_tax() ) ) ) { | |
$page_layout = et_get_option( 'divi_shop_page_sidebar', 'et_left_sidebar' ); | |
} | |
// Set post meta layout which will work for all third party plugins. | |
elseif ( false == ( $page_layout = get_post_meta( get_queried_object_id(), '_et_pb_page_layout', true ) ) ) { |
This file contains 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_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
This file contains 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 user after successful login. | |
* | |
* @param string $redirect_to URL to redirect to. | |
* @param string $request URL the user is coming from. | |
* @param object $user Logged user's data. | |
* @return string | |
*/ | |
function my_login_redirect( $redirect_to, $request, $user ) { | |
//is there a user to check? |
This file contains 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
$post = array( | |
'ID' => [ <post id> ] // Are you updating an existing post? | |
'post_content' => [ <string> ] // The full text of the post. | |
'post_name' => [ <string> ] // The name (slug) for your post | |
'post_title' => [ <string> ] // The title of your post. | |
'post_status' => [ 'draft' | 'publish' | 'pending'| 'future' | 'private' | custom registered status ] // Default 'draft'. | |
'post_type' => [ 'post' | 'page' | 'link' | 'nav_menu_item' | custom post type ] // Default 'post'. | |
'post_author' => [ <user ID> ] // The user ID number of the author. Default is the current user ID. | |
'ping_status' => [ 'closed' | 'open' ] // Pingbacks or trackbacks allowed. Default is the option 'default_ping_status'. | |
'post_parent' => [ <post ID> ] // Sets the parent of the new post, if any. Default 0. |
NewerOlder