Skip to content

Instantly share code, notes, and snippets.

@codeastrology-dev
codeastrology-dev / end_part_advance_search_box.php
Created January 29, 2023 11:45
Add something after the search field of the advanced search box
<?php
/**
* Author: Hannan
* Desc: Add extra - something at the end part of advance search box.
* Date: 29.01.2023
* */
function codeastrology_search_end_part( ){
return sprintf('<a href="%s" class="button"> %s</a>','https://www.google.com/','Google Search');
}
@codeastrology-dev
codeastrology-dev / wpt_paginate_args.php
Created January 22, 2023 10:43
To get pagination arguments
<?php
/*
@author: Hannan- CodeAstrology
@date: 22.01.2023
@description: Get prodcut table pagination arguments
*/
function codeastrology_pagination( $args ){
// var_dump($args);
@codeastrology-dev
codeastrology-dev / wpt_minifilter_taxonomy_name.php
Last active January 22, 2023 09:51
To change product table mini filter default taxonomy label and taxonomy name.
<?php
/*
Author: Hannan ( CodeAstrology)
Date: 22.01.23
Description: change the product table mini filter default taxonomy label and taxonomy name.
*/
function codeastrology_minifilter_taxonomy_name( $label, $texonomy_name ){
<?php
<meta name="description" content="This is the description sentence or short paragraph about the article or post." />
<?php
function codeastrology_meta_tags() {
echo '<meta name="meta_name" content="meta_value" />';
}
add_action('wp_head', ' codeastrology_meta_tags');
<?php
function codeastrology_meta_description() {
global $post;
if ( is_singular() ) {
$des_post = strip_tags( $post->post_content );
$des_post = strip_shortcodes( $post->post_content );
$des_post = str_replace( array("\n", "\r", "\t"), ' ', $des_post );
$des_post = mb_substr( $des_post, 0, 300, 'utf8' );
echo '<meta name="description" content="' . $des_post . '" />' . "\n";
}
@codeastrology-dev
codeastrology-dev / wpt_footer_cart_template.php
Created January 17, 2023 05:21
To change the Product Table Footer cart Template
@codeastrology-dev
codeastrology-dev / wpt_query_args.php
Created January 16, 2023 04:16
To change product table query arguments.
<?php
/* change product table query arguments */
function codeastrology_custom_query( $args, $shortcode ){
//var_dump($shortcode); //You can more customise using $shortcode
$args['posts_per_page'] = 2;
return $args;
}
add_filter('wpt_query_args','codeastrology_custom_query', 10, 2);
@codeastrology-dev
codeastrology-dev / wpt_view_cart_text.php
Created January 16, 2023 04:12
Used to change view cart text.
<?php
/* To change product table view cart text*/
function codeastrology_view_cart_text( $text ){
$text = "Basket";
return $text;
}
add_filter('wpt_view_cart_text','codeastrology_view_cart_text');
@codeastrology-dev
codeastrology-dev / wpt_view_footer_cart_target.php
Created December 28, 2022 12:27
Use to change footer cart target