Skip to content

Instantly share code, notes, and snippets.

View Matteo182's full-sized avatar

Matteo Ragusa Matteo182

View GitHub Profile
@Matteo182
Matteo182 / wordpress-breadcrumbs.php
Created January 20, 2020 12:28
show breadcrumbs in wordpress theme custom
// Breadcrumbs
function get_breadcrumbs() {
// Settings
$separator = '>';
$breadcrums_id = 'breadcrumbs';
$breadcrums_class = 'breadcrumbs';
$home_title = 'Homepage';
// If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)
@Matteo182
Matteo182 / set_ posts_per_page.php
Created February 13, 2020 09:06
Set the number of posts on the page for all site queries in WordPress
// Set the number of posts on the page for all site queries
function tdm_filter_pre_get_posts( $query ) {
$query->set( 'posts_per_page',9 ); // 9 post per page
return $query;
}
add_filter( 'pre_get_posts', 'tdm_filter_pre_get_posts' );
@Matteo182
Matteo182 / csv_to_json.php
Created March 30, 2020 11:17
converte csv to json
<?php
/**
* Template Name: from csv to create json
*
* Template for converte csv to json.
*
* @package understrap
*/
if ( ! defined( 'ABSPATH' ) ) {
@Matteo182
Matteo182 / user_profile.php
Created April 3, 2020 17:36
Front_end profile page in WordPress
<?php
/**
* The template for displaying user profile in front_end
*
* This is the template that displays user profile in fron_end.
*
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;