Skip to content

Instantly share code, notes, and snippets.

View shubhw12's full-sized avatar
🎯
Focusing

Shubham Wagh shubhw12

🎯
Focusing
  • Pune
View GitHub Profile
@shubhw12
shubhw12 / gist:7cb7c94d1ce2825138fec95f3e839630
Created March 11, 2020 13:16
Add a div after the site branding div
/**
* Site Title / Logo
*
* @since 1.0.0
*/
function astra_site_branding_markup() {
?>
<div class="site-branding">
<div
<?php
@shubhw12
shubhw12 / gist:081d643fe4701f56400fba2bac42ca4b
Last active April 13, 2020 05:17
Add the quantity button next to add to cart button in astra on shop page
function custom_quantity_field_archive() {
$product = wc_get_product( get_the_ID() );
if ( ! $product->is_sold_individually() && 'variable' != $product->product_type && $product->is_purchasable() ) {
woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity() ) );
}
}
@shubhw12
shubhw12 / gist:1fff5ff99434cc0b4581606029354771
Created February 28, 2020 06:35
Remove link rel attribute.
add_action('wp', 'remove_pingback');
function remove_pingback(){
remove_action('wp_head', 'astra_pingback_header');
}
@shubhw12
shubhw12 / gist:645000abc7baa99d2ed0668799176a0d
Created February 28, 2020 05:48
Remove archives word from the archive pages.
add_filter('get_the_archive_title', function ($title) {
return preg_replace('/^\w+: /', '', $title);
});
@shubhw12
shubhw12 / gist:12f204c61b7d5854507a124676159816
Created February 16, 2020 14:14
display tags below post
add_filter( 'astra_post_tags', 'remove_tags_callback' );
function remove_tags_callback(){
return ' ';
}
add_action( 'astra_entry_after' , 'add_tags_callback');
function add_tags_callback(){
@shubhw12
shubhw12 / gist:5e4d550a648f91496ca5fca1ace01394
Created February 4, 2020 13:53
Remove the author link in from the archive page meta. Can paste the code in functions.php of child theme
function astra_post_author( $output_filter = '' ) {
ob_start();
echo '<span ';
echo astra_attr(
'post-meta-author',
array(
'class' => 'posted-by vcard author',
)
@shubhw12
shubhw12 / pagination.php
Created January 29, 2020 10:34
To get page pagination on the top of the archive pages
add_action('astra_archive_header','function_call_astra_number' );
function function_call_astra_number() {
astra_number_pagination();
}
function astra_number_pagination() {
global $numpages;
$enabled = apply_filters( 'astra_pagination_enabled', true );
$numpages = 1;