Skip to content

Instantly share code, notes, and snippets.

View misiura-codes's full-sized avatar

Roman Misiura misiura-codes

  • Poland
  • 12:39 (UTC +01:00)
View GitHub Profile
/* Wordpress Tables */
DELETE FROM wp_termmeta WHERE meta_id=0;
DELETE FROM wp_terms WHERE term_id=0;
DELETE FROM wp_term_taxonomy WHERE term_taxonomy_id=0;
DELETE FROM wp_commentmeta WHERE meta_id=0;
DELETE FROM wp_comments WHERE comment_ID=0;
DELETE FROM wp_links WHERE link_id=0;
DELETE FROM wp_options WHERE option_id=0;
DELETE FROM wp_postmeta WHERE meta_id=0;
DELETE FROM wp_users WHERE ID=0;
@misiura-codes
misiura-codes / post_share.php
Created December 10, 2019 17:53
wp post share links
<div class="blog-single-social-sharing-container">
<ul class="blog-single-social-sharing noselect">
<li><a href="https://twitter.com/share?text=<?php echo htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); ?>&url=<?php echo urlencode(the_permalink()); ?>" title="<?php esc_html_e( 'Twitter', 'progression-elements-ratency' ); ?>" class="twitter-share" target="_blank"><div class="progression-unskew-text"><i class="fa fa-twitter"></i><span class="progression-single-dash">&ndash;</span><span class="blog-single-sharing-text"><?php echo esc_html__( 'Share on Twitter', 'progression-elements-ratency' ); ?></span></div></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=<?php echo urlencode(the_permalink()); ?>&t=<?php echo htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); ?>" title="<?php esc_html_e( 'Share on Facebook', 'progression-elements-ratency' ); ?>" class="facebook-share" target=
@misiura-codes
misiura-codes / post_share.php
Created December 10, 2019 17:53
wp post share links
<div class="blog-single-social-sharing-container">
<ul class="blog-single-social-sharing noselect">
<li><a href="https://twitter.com/share?text=<?php echo htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); ?>&url=<?php echo urlencode(the_permalink()); ?>" title="<?php esc_html_e( 'Twitter', 'progression-elements-ratency' ); ?>" class="twitter-share" target="_blank"><div class="progression-unskew-text"><i class="fa fa-twitter"></i><span class="progression-single-dash">&ndash;</span><span class="blog-single-sharing-text"><?php echo esc_html__( 'Share on Twitter', 'progression-elements-ratency' ); ?></span></div></a></li>
<li><a href="http://www.facebook.com/sharer.php?u=<?php echo urlencode(the_permalink()); ?>&t=<?php echo htmlspecialchars(urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); ?>" title="<?php esc_html_e( 'Share on Facebook', 'progression-elements-ratency' ); ?>" class="facebook-share" target=
@misiura-codes
misiura-codes / asyncData
Created December 5, 2019 10:43 — forked from kayvazov/asyncData.js
asyncData.js for Vue ( without Nuxt.js )
// asyncData.js
export default ({ store, router }) => async (to, from, next) => {
const matched = router.getMatchedComponents(to);
const prevMatched = router.getMatchedComponents(from);
let diffed = false;
const activated = matched.filter((c, i) => {
const isActivated = diffed || (diffed = (prevMatched[i] !== c));
return isActivated;
});
@misiura-codes
misiura-codes / dividing_the_menu_in_half.php
Created August 6, 2019 11:27 — forked from campusboy87/dividing_the_menu_in_half.php
Деление WordPress меню пополам
<?php
add_filter( 'wp_nav_menu_objects', function ( $menu_items, $args ) {
if ( $args->theme_location !== 'menu-1' ) {
return $menu_items;
}
static $average_cnt = null;
static $items = [];
if ( $average_cnt === null ) {
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@misiura-codes
misiura-codes / for-functions.php
Created May 19, 2017 13:25
Add this code for functions.php
/**
* AJAX load-more button
*/
// Hooks for AJAX
function ajax_frontend() { // Add script ot theme
wp_enqueue_script( 'ajax-pagination', get_template_directory_uri().'/assets/js/jquery-pagination.js', array('jquery'), '1.0');
}
// Set variables on front-end
function js_variables(){