Skip to content

Instantly share code, notes, and snippets.

View Zurabpwnz's full-sized avatar
🏠
Working from home (Vue.js is our everything)

Zurab Shyvarbidze Zurabpwnz

🏠
Working from home (Vue.js is our everything)
View GitHub Profile
@Zurabpwnz
Zurabpwnz / share-urls.md
Created April 14, 2023 14:34 — forked from apisandipas/share-urls.md
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@Zurabpwnz
Zurabpwnz / acf_options_multilingual.php
Created March 19, 2023 10:18 — forked from zeshanshani/acf_options_multilingual.php
Creates separate Advanced Custom Fields options pages for the specified languages.
<?php // Don't copy this line if you are inserting in a file that has it already.
/**
* ACF Options Page
*
* Instructions:
* Add more languages to the array below: $languages
*
* @author: Zeshan Ahmed <https://zeshanahmed.com/>
*/
@Zurabpwnz
Zurabpwnz / Github-actions.md
Created January 31, 2023 22:02 — forked from ArtMan-8/Github-actions.md
Базовая настройка github actions для запуска тестов и автоматической сборки проекта на gh-pages

Настройка github actions для тестов и сборки на gh-pages

Прежде всего нужно создать ключ для доступа к репозиториям. Один ключ можно использовать для разных репозиториев. Для этого идём в github, в настройки разработчика, и переходим к персональным токенам и жмём сюда для генерации ключа.


При генерации ключа отмечаем поля repo, workflow, user, даём название и копируем сам ключ.

@Zurabpwnz
Zurabpwnz / functions.php
Created November 20, 2022 15:22 — forked from seredniy/functions.php
Изменяем title на страницах пагинации Yoast Seo
if ( ! function_exists( 't5_add_page_number' ))
{
function t5_add_page_number( $s )
{
global $page;
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
! empty ( $page ) && 1 < $page && $paged = $page;
// $paged > 1 && $s .= ' | ' . sprintf( __( 'Страница %s' ), $paged );
@Zurabpwnz
Zurabpwnz / functions.php
Created November 20, 2022 15:22 — forked from seredniy/functions.php
Изменяем title на страницах пагинации Yoast Seo
if ( ! function_exists( 't5_add_page_number' ))
{
function t5_add_page_number( $s )
{
global $page;
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
! empty ( $page ) && 1 < $page && $paged = $page;
// $paged > 1 && $s .= ' | ' . sprintf( __( 'Страница %s' ), $paged );
@Zurabpwnz
Zurabpwnz / WordPress - Woocommerce tracking code
Created October 21, 2022 22:53 — forked from celticwebdesign/WordPress - Woocommerce tracking code
Add Woocommerce products tracking code before main Google Analytics code in header.php
header.php
<?php
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
// echo $wp->query_vars['order-received'];
// Lets grab the order
$order = wc_get_order( $wp->query_vars['order-received'] );
# Find the latest version on https://github.com/creationix/nvm#install-script
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Add in your ~/.zshrc the following:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ source ~/.zshrc
@Zurabpwnz
Zurabpwnz / woo-events.js
Created July 6, 2022 07:14 — forked from bagerathan/woo-events.js
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
<!DOCTYPE HTML>
<html prefix="og: http://ogp.me/ns#">
<head>
<title>[[*title]]</title>
<meta charset="utf-8" />
<base href="[[++site_url]]" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="[[*description]]" />
<meta name="keywords" content="[[*keywords]]" />
@Zurabpwnz
Zurabpwnz / gist:0e924db374d1ffd98f34bd895289b6f7
Created March 29, 2021 09:59 — forked from mikejolley/gist:2044109
WooCommerce - Update number of items in cart and total after Ajax
<?php
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );
function woocommerce_header_add_to_cart_fragment( $fragments ) {
ob_start();
?>
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
<?php