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
<form role="search" method="post" class="search-form padding-4" action="<?php echo home_url( '/' ); ?>"> | |
<label> | |
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span> | |
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search...', 'placeholder' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" /> | |
<input class="post_type" type="hidden" name="post_type" value="frequent" /> | |
</label> | |
<input type="submit" class="search-submit button brand" id="searchsubmit" value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" /> | |
</form> | |
<script type="text/javascript"> |
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 | |
//Import the PHPMailer class into the global namespace | |
use PHPMailer\PHPMailer\PHPMailer; //important, on php files with more php stuff move it to the top | |
use PHPMailer\PHPMailer\SMTP; //important, on php files with more php stuff move it to the top | |
//SMTP needs accurate times, and the PHP time zone MUST be set | |
//This should be done in your php.ini, but this is how to do it if you don't have access to that | |
date_default_timezone_set('Etc/UTC'); | |
require 'path/to/vendor/autoload.php'; //important |
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 | |
function custom_user_role() { | |
// get user | |
$user = new WP_User( <user-ID> ); | |
//$user = new WP_User( '<user-login-name>' ); | |
//$user = wp_get_current_user(); | |
// modify roles | |
// for example, set/unset them as administrator | |
$user->add_role( 'administrator' ); |
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 | |
/** | |
* Page slug body class | |
* https://www.wpbeginner.com/wp-themes/how-to-add-page-slug-in-body-class-of-your-wordpress-themes/ | |
* | |
*/ | |
function add_slug_body_class( $classes ) { | |
global $post; | |
if ( isset( $post ) ) { |
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 | |
/** | |
* Source: https://hirejordansmith.com/how-to-check-if-page-is-parent-child-or-ancestor-of-current-page/ | |
* | |
*/ | |
// Check for a specific page | |
if ( is_page(2) ) { | |
// stuff | |
} |
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
<div class="html-sitemap"> | |
<h2>Author(s):</h2> | |
<ul class="sitemap-authors"> | |
<?php | |
//http://codex.wordpress.org/Function_Reference/wp_list_authors | |
wp_list_authors('exclude_admin=1&optioncount=1'); | |
?> | |
</ul> | |
<h2>Pages:</h2> |
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
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> |
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
############################################################################################### | |
# https://www.educative.io/answers/the-fatal-refusing-to-merge-unrelated-histories-git-error | |
# | |
# The “fatal: refusing to merge unrelated histories” Git error occurs when two unrelated | |
# projects are merged (i.e., projects that are not aware of each other’s existence and | |
# have mismatching commit histories). | |
# | |
# The error is resolved by toggling the allow-unrelated-histories switch. | |
# After a `git pull` or `git merge` command, add the following tag: | |
# |
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 | |
if ( ! class_exists( 'VcSodaBlockquote' ) ) { | |
class VcSodaBlockquote extends WPBakeryShortCode { | |
//Initialize Component | |
function __construct() { | |
add_action( 'init', array( $this, 'create_shortcode' ), 999 ); | |
add_shortcode( 'vc_soda_blockquote', array( $this, 'render_shortcode' ) ); |
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 | |
/** | |
* https://kb.wpbakery.com/docs/theme-integration-technical/theme-integration-technical/ | |
* Include the TGM_Plugin_Activation class. | |
*/ | |
require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php'; | |
add_action( 'tgmpa_register', 'my_theme_register_js_composer_plugins' ); | |
/** | |
* Register the required plugins for this theme. | |
* |