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_filter( | |
'init', | |
function() { | |
global $wp_locale, $wp_styles; | |
$direction = 'ltr'; | |
$wp_locale->text_direction = $direction; | |
if ( ! is_a( $wp_styles, 'WP_Styles' ) ) { | |
$wp_styles = new WP_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
/** | |
* Display search form. | |
* | |
* @param bool $echo Default to echo and not return the form. | |
* @return string|void String when $echo is false. | |
*/ | |
function astra_get_search_form( $echo = true ) { | |
$form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '"> | |
<label> |
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 async attr to the Astra Script. | |
* | |
* @param string $tag Tag for the script. | |
* @param string $handle Handle for the script. | |
* | |
* @return string | |
*/ | |
function add_async_attribute( $tag, $handle ) { | |
if ( 'astra-theme-js' === $handle ) { |
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 | |
add_filter( 'astra_schema_body', '__return_empty_string' ); | |
add_action( | |
'init', | |
function() { | |
remove_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 ); | |
} | |
); |
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
/** | |
* Stop date from google crawling. | |
* | |
* @param string $output Markup for the last modified date. | |
* | |
* @return void | |
*/ | |
function your_prefix_post_date( $output ) { | |
$output = ''; |
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 | |
// Command - wp delete-astra-option delete --key={astra-settings key} | |
namespace DeleteAstraOption; | |
use WP_CLI, WP_CLI_Command; | |
if( class_exists( 'WP_CLI_Command' ) ) { | |
class Commands extends WP_CLI_Command { | |
public function delete( $args, $assoc_args ) { | |
$option_key = isset( $assoc_args['key'] ) ? $assoc_args['key'] : false; | |
if( ! $option_key ) { |
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_filter( 'astra_comment_form_default_fields_markup', 'astra_remove_website_url_comment' ); | |
function astra_remove_website_url_comment( $fields ) { | |
if ( isset( $fields['url'] ) ) { | |
unset( $fields['url'] ); | |
return $fields; | |
} | |
} |
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
/** | |
* Archive Page Title | |
*/ | |
if ( ! function_exists( 'astra_archive_page_info' ) ) { | |
/** | |
* Wrapper function for the_title() | |
* | |
* Displays title only if the page title bar is disabled. | |
*/ |
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_action( 'astra_template_parts_content_top', 'astra_disable_comment_template', 15 ); | |
function astra_disable_comment_template() { | |
remove_action( 'astra_page_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); | |
remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); | |
} |
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_action( 'wp', 'astra_search_grid_check', 15 ); | |
function astra_search_grid_check() { | |
if( is_search() ) { | |
add_filter( 'astra_get_option_blog-grid', 'astra_change_grid_search_page', 15, 3 ); | |
} | |
} | |
function astra_change_grid_search_page( $value, $option, $default ) { | |
$value = '2'; |
OlderNewer