Skip to content

Instantly share code, notes, and snippets.

Avatar
🤡
code fool

Humayun Ahmed humayunahmed8

🤡
code fool
View GitHub Profile
@humayunahmed8
humayunahmed8 / wc-display-my-account-template.php
Created Apr 11, 2021 — forked from woogists/wc-display-my-account-template.php
[Theming Snippets] Display my-account link in a template file
View wc-display-my-account-template.php
<?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 Oct 27, 2020 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
View remove_checkout_fields.php
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 Oct 20, 2020 — forked from mohandere/get-isotope-items.php
jQuery isotope plugin for wordpress posts filtering by category with pagination.
View get-isotope-items.php
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
View the_post_navigation.php
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 ;
View gist:9e769292af93abb3ee7d476867da921a
Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
View Fraud Client Protection for wordpress.php
<?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 Sep 8, 2018 — forked from irazasyed/ampps-mysql-fix.md
AMPPS MySQL not working, Solution!
View ampps-mysql-fix.md

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.

View google-fonts-the-right-way.php
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 = '';
@humayunahmed8
humayunahmed8 / google-fonts.php
Created Aug 7, 2018 — forked from raselahmed7/google-fonts.php
How to call google fonts from theme option in best way
View google-fonts.php
<?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'];
View stock-googlemap-shortcode.php
<?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',