Skip to content

Instantly share code, notes, and snippets.

View Codevz's full-sized avatar
🎯
Focusing

Codevz Codevz

🎯
Focusing
View GitHub Profile
@Codevz
Codevz / codevz-page-meta.php
Last active June 18, 2022 10:36
XTRA WP Theme modify a page meta option value via custom WordPress filter, https://xtratheme.com/
<?php
/**
* With this function you can modify any options value for specific page or post.
*
* @var $meta saved page/post settings
* @var $post_id current page/post ID
*
* @return array
*/
@Codevz
Codevz / codevz-option-logo.php
Last active June 18, 2022 10:36
XTRA WP Theme modify a global option value on individual pages or posts via custom WordPress filter, https://xtratheme.com/
<?php
/**
* With this function you can modify an specific option value for specific page or post.
*
* @var $value saved theme option value
*
* @return string|array
*/
function codevz_custom_logo( $value ) {
@Codevz
Codevz / codevz-options.php
Last active June 18, 2022 10:36
XTRA WP Theme modify any options value on any individual pages and posts, https://xtratheme.com/
<?php
/**
* With this function you can modify any options value for specific page or post.
*
* @var $value saved theme options value
*
* @return string|array
*/
function codevz_custom_options( $options ) {
@Codevz
Codevz / codevz-single-featured-image.php
Last active June 18, 2022 10:36
XTRA WP Theme - Modify HTML of featured image and post format, https://xtratheme.com/
@Codevz
Codevz / codevz-archive-thumbnail-size.php
Last active June 18, 2022 10:36
XTRA WP Theme - Change posts featured image size on archive pages, https://xtratheme.com/
<?php
/**
* With this function you can modify single post featured image including post format HTML data.
*
* @var $value HTML of featured image and post format.
*
* @return string
*/
function codevz_xtra_archive_thumbnail_size( $size, $post_type ) {
@Codevz
Codevz / codevz-disable-google-fonts.php
Last active June 18, 2022 10:37
XTRA WP Theme - Disable google fonts, https://xtratheme.com/
<?php
/**
* With this filter you can completely disable google fonts.
*
* @return boolean
*/
add_filter( 'codevz/disable/google_fonts', '__return_true' );
//
@Codevz
Codevz / codevz-before-archive-content.php
Last active June 18, 2022 10:35
XTRA WP Theme - Add content before archive content, https://xtratheme.com/
<?php
/**
* With this function you can add any custom contetn, HTML, shortcode before any archive pages.
*
* @var $post_type post type slug
*/
function my_prefix_before_archive_content( $post_type ) {
if ( $post_type === 'post' ) {
@Codevz
Codevz / codevz_before_archive_content.php
Last active June 18, 2022 10:35
XTRA WP Theme - Action hook for adding content before any post types archive pages, https://xtratheme.com/
<?php
/**
* With this function you can add any content or php codes before post type archive pages.
*
* @var $post_type will return current post type name
*/
function my_prefix_before_archive( $post_type ) {
if ( $post_type === 'portfolio' ) {
@Codevz
Codevz / codevz-archive-after.php
Last active June 18, 2022 10:34
XTRA WP Theme - Action hook for adding content after any post types archive pages, https://xtratheme.com/
<?php
/**
* With this function you can add any content or php codes after post type archive pages.
*
* @var $post_type will return current post type name
*/
function my_prefix_after_archive( $post_type ) {
if ( $post_type === 'portfolio' ) {
@Codevz
Codevz / codevz-single-before_meta.php
Last active June 18, 2022 10:34
XTRA WP Theme - Action hook for adding content before any single posts meta, https://xtratheme.com/
<?php
/**
* With this function you can add any content or php codes before posts meta in single post page.
*
* @var $post current post object
*/
function codevz_single_before_meta( $post ) {
if ( $post->ID === 22 ) {