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 unwanted values from font awesome json object | |
* | |
* @since 1.0.0 | |
* @param array $json Decoded fontawesome json file data. | |
*/ | |
public static function remove_unwanted_data( $json ) { | |
// Remove unwanted code from the json file |
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_customizer_configurations', 'register_configuration', 999, 2 ); | |
function register_configuration( $configurations, $wp_customize ) { | |
$arr = array(); | |
foreach ($configurations as $key => $value) { |
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 new_excerpt_more( $output, $output_filter ) { | |
$output = str_replace( ' …' , '', $output ); | |
return $output; | |
} | |
add_filter('astra_the_content_more_link', 'new_excerpt_more', 10, 2); |
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_post_author', 'change_author_links', 10, 2 ); | |
function change_author_links( $output, $output_filter ) { | |
ob_start(); | |
echo '<span '; | |
echo astra_attr( | |
'post-meta-author', | |
array( | |
'class' => 'posted-by vcard author', | |
'itemtype' => 'https://schema.org/Person', |
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 current year | |
function year_shortcode () { | |
$year = date_i18n('Y'); | |
return $year; | |
} | |
add_shortcode ('year', 'year_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
//Insert ads after second and fifth paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
// Add your ads code here | |
$ad_code = '<div>Ads code goes here</div>'; | |
if ( is_single() && ! is_admin() ) { | |
/* Change the paragraph number as per your preference, currently with the following code the Ads code can be added after the second and fifth paragraph */ | |
return prefix_insert_after_paragraph( $ad_code, array( 2, 5 ) , $content ); | |
} | |
return $content; |
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
//Insert ads after fifth and seventh paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
// Add your after 5th paragraph ad code first and then the 7th paragraph ads code. | |
$ad_code = array( | |
'<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<!-- Mypt3 300x250 (M) --> | |
<ins class="adsbygoogle" |
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
//Insert ads after fifth and seventh paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
// Add your after 5th paragraph ad code first and then the 7th paragraph ads code. | |
$ad_code = array( | |
'<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<!-- Mypt3 300x250 (M) --> | |
<ins class="adsbygoogle" |
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 CSS style coming from custom fonts. | |
add_action( 'wp', 'remove_styles' ); | |
function remove_styles() { | |
if( class_exists( 'Bsf_Custom_Fonts_Render' ) ) { | |
remove_action( 'wp_head', array( Bsf_Custom_Fonts_Render::get_instance(), 'add_style' ) ); | |
} | |
} |
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_enqueue_scripts', function() { | |
if ( ! class_exists( 'Elementor\Core\Files\CSS\Post' ) ) { | |
return; | |
} | |
// Add your header page id here. | |
$header_page_id = 3499; | |
$css_file = new Elementor\Core\Files\CSS\Post( $header_page_id ); | |
$css_file->enqueue(); |
OlderNewer