Skip to content

Instantly share code, notes, and snippets.

View humayunahmed8's full-sized avatar
🤡
code fool

Humayun Ahmed humayunahmed8

🤡
code fool
View GitHub Profile
if ( ! function_exists( 'prefix_fonts_url' ) ) :
/**
* Register Google fonts.
*
* @return string Google fonts URL for the theme.
*/
function prefix_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = '';
<?php
function stock_styled_map_shortcode($atts, $content = null) {
extract( shortcode_atts( array(
'lat' => '40.7433379',
'lng' => '-74.0103219',
'title' => 'Head Office',
'desc' => 'House 21, Grand St.<br/> New York, USA',
@humayunahmed8
humayunahmed8 / wc-display-my-account-template.php
Created April 11, 2021 08:22 — forked from woogists/wc-display-my-account-template.php
[Theming Snippets] Display my-account link in a template file
<?php if ( is_user_logged_in() ) { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a>
<?php }
else { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a>
<?php } ?>
@humayunahmed8
humayunahmed8 / remove_checkout_fields.php
Created October 27, 2020 11:14 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
@humayunahmed8
humayunahmed8 / get-isotope-items.php
Created October 20, 2020 02:50 — forked from mohandere/get-isotope-items.php
jQuery isotope plugin for wordpress posts filtering by category with pagination.
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
Use WordPress default function to get next and previous post title with permalink something like this:
<?php // FOR PREVIOUS POST
$prev_post = get_previous_post();
$id = $prev_post->ID ;
$permalink = get_permalink( $id );
?>
<?php // FOR NEXT POST
$next_post = get_next_post();
$nid = $next_post->ID ;
Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
<?php
//save theme active time
function my_theme_activation_init() {
// Check if already saved the activation date & time
// to prevent over-writing if user deactive & active theme
// multiple time
if(!get_option('mytheme_activation_time', false)){
@humayunahmed8
humayunahmed8 / ampps-mysql-fix.md
Created September 8, 2018 08:02 — forked from irazasyed/ampps-mysql-fix.md
AMPPS MySQL not working, Solution!

AMPPS MySQL not working, Solution!

  1. Open Ampps Application -> MySQL Tab -> Configuration.

  2. In [mysqld] section, add the following line: innodb_force_recovery = 1

  3. Save the file and try starting MySQL

  4. Remove that line which you just added and Save.

@humayunahmed8
humayunahmed8 / google-fonts.php
Created August 7, 2018 09:45 — forked from raselahmed7/google-fonts.php
How to call google fonts from theme option in best way
<?php
$frozen_body_font_get = cs_get_option('frozen_body_font');
$frozen_heading_font_get = cs_get_option('frozen_headding_font');
function frozen_crazycafe_body_gf_url() {
$font_url = '';
$frozen_body_font_get = cs_get_option('frozen_body_font');
if(array_key_exists('family', $frozen_body_font_get)) {
$frozen_body_font_get_family = $frozen_body_font_get['family'];