Skip to content

Instantly share code, notes, and snippets.

View evgrezanov's full-sized avatar
:octocat:
Working from home

Evgeniy Rezanov evgrezanov

:octocat:
Working from home
View GitHub Profile
@evgrezanov
evgrezanov / yoast-seo-sitemap.php
Created April 30, 2017 18:31 — forked from mohandere/yoast-seo-sitemap.php
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index
@evgrezanov
evgrezanov / wp_get_object_terms_exclude_filter.php
Created August 9, 2017 01:23 — forked from dan-westall/wp_get_object_terms_exclude_filter.php
Allowing wp_get_object_terms to exclude terms with a filter.
<?php
///////Example usage//////////
//get object terms for $post->ID with taxonomies categories and tags,
//args set as fields all and exclude term with id 1
$terms = wp_get_object_terms(
$post->ID,
array(
@evgrezanov
evgrezanov / functions.php
Created October 3, 2017 02:37 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
### Keybase proof
I hereby claim:
* I am evgrezanov on github.
* I am redmonkey73 (https://keybase.io/redmonkey73) on keybase.
* I have a public key ASAVm8J5FPky5p_VG-b8sSa5YPj4M-8JnnpL-0bfZKpwsgo
To claim this, I am signing this object:
@evgrezanov
evgrezanov / userlogingenerate.php
Created August 9, 2018 12:06 — forked from aiiddqd/userlogingenerate.php
Generate user login in WordPress - function example
<?php
/**
* Generate login for new WP user
*
* return string uniq login
*/
function generate_new_userlogin(){
$users_ids = get_users('fields=ID&number=3&orderby=registered&order=DESC');
$last_id = max($users_ids);
@evgrezanov
evgrezanov / change_link.php
Last active July 11, 2019 18:38 — forked from igorbenic/change_link.php
Custom WordPress Rewrite Rule to Combine Taxonomy and Post Type | www.ibenic.com/custom-wordpress-rewrite-rule-combine-taxonomy-post-type
@evgrezanov
evgrezanov / Keybase.md
Created November 28, 2019 18:54
Keybase

Keybase proof

I hereby claim:

  • I am evgrezanov on github.
  • I am redmonkey73 (https://keybase.io/redmonkey73) on keybase.
  • I have a public key ASCF7zWRYJ4CbNIP-YQpAdsrW63us9iTtEtxnqXNbZ8BWAo

To claim this, I am signing this object:

@evgrezanov
evgrezanov / Car.php
Created November 30, 2019 13:44 — forked from jgrossi/Car.php
How to use Eloquent (from Laravel) inside Wordpress
<?php // File location: /wp-content/themes/my-theme/src/Models/
namespace App\Models;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Car extends Eloquent
{
protected $table = 'cars';
protected $primaryId = 'id';
@evgrezanov
evgrezanov / example.js
Created January 18, 2020 11:02 — forked from aiiddqd/example.js
Universal Ajax Form handler by vanilla JavaScript
FormAjax('#loginform', 'sb/v1/user/signin');