Skip to content

Instantly share code, notes, and snippets.

document.addEventListener('DOMContentLoaded', function() {
const modalComponent = () => {
const countriesModal = document.querySelector("#country-input");
const content =
`
<div class="modal-grey"></div>
<div class="modal-btn-wrap">
<?php
$menuParameters = array(
'theme_location' => 'name_location',
'container' => false,
'echo' => false,
'menu_class' => 'menu_classes',
'items_wrap' => '<nav id="%1$s" class="%2$s">%3$s</nav>',
'depth' => 0,
);
<?php
$product_categories = array('cat-name');
$wc_query = new WP_Query(array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => 10,
'tax_query' => array(array(
'taxonomy' => 'product_cat',
// Get Product ID
$product->get_id(); (fixes the error: "Notice: id was called incorrectly. Product properties should not be accessed directly")
// Get Product General Info
$product->get_type();
$product->get_name();
$product->get_slug();
$product->get_date_created();
<?php
// $acf_field = get_field('acf_field');
// FROM SAME CATEGORY
// $categories = get_the_category();
// postid = get_the_ID();
$query = new WP_Query(array(
'post_type' => 'post',
'posts_per_page' => 1,
(function ($) {
var app = function () {
this.body = $('body');
//CREATE FUNCTIONS FOR THE SITE
var mapController = function () {
var map = L.map('map').setView([-22.760733, -41.890303], 15);
var pageTransition = function () {
var FadeTransition = Barba.BaseTransition.extend({
start: function () {
Promise
.all([this.newContainerLoading, this.fadeOut()])
.then(this.fadeIn.bind(this));
},
fadeOut: function () {
@murillocamargo
murillocamargo / Wordpress-social-media-share.php
Last active January 19, 2020 00:59
Example of custom social media share links with Wordpress default permalink and title functions
http://www.facebook.com/sharer/sharer.php?u=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?>
http://twitter.com/intent/tweet?status=<?php print(urlencode(the_title())); ?>+<?php print(urlencode(get_permalink())); ?>
https://plus.google.com/share?url=<?php print(urlencode(get_permalink())); ?>
https://www.linkedin.com/shareArticle?mini=true&url=<?php print(urlencode(get_permalink())); ?>&title=<?php print(urlencode(the_title())); ?>
whatsapp://send?text=<?php the_title(); ?> - <?php the_permalink(); ?> data-action="share/whatsapp/share"
UPDATE wp_options
SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com')
WHERE option_name = 'home'
OR option_name = 'siteurl';
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');