%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/
Upload File :
Create Path :
Current File : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/extras.php

<?php

// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }


/**
 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
 *
 * @param array $args Configuration arguments.
 * @return array
 */
function levelup_page_menu_args( $args ) {
	$args['show_home'] = true;
	return $args;
}
add_filter( 'wp_page_menu_args', 'levelup_page_menu_args' );

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function levelup_body_classes( $classes ) {
	$config = Levelup_Config::get_instance();

	// Adds a class of group-blog to blogs with more than 1 published author.
	if ( is_multi_author() ) {
		$classes[] = 'group-blog';
	}

	return array_values( array_unique( $classes ) );
}
add_filter( 'body_class', 'levelup_body_classes' );

/**
 * Filters wp_title to print a neat <title> tag based on what is being viewed.
 *
 * @param string $title Default title text for current view.
 * @param string $sep Optional separator.
 * @return string The filtered title.
 */


function levelup_wp_title_slides( $title ) {
	$slides_title = levelup_get_options( 'project-list__html_title' );
	if ( $slides_title ) {
		$title = esc_html( $slides_title );
	}

	return $title;
}


if ( function_exists( 'wp_get_document_title' ) ) {
	function levelup_pre_get_document_title( $title ) {
		if ( is_post_type_archive( 'rdy_project' ) ) {
			$title = levelup_wp_title_slides( $title );
		}

		return $title;
	}

	add_filter( 'pre_get_document_title', 'levelup_pre_get_document_title' );
	add_filter( 'wpseo_title', 'levelup_pre_get_document_title' );
} else {
	function levelup_wp_title( $title, $sep ) {
		if ( is_post_type_archive( 'rdy_project' ) ) {
			$title = levelup_wp_title_slides( $title );
		}

		return $title;
	}
	add_filter( 'wp_title', 'levelup_wp_title', 10, 2 );
}


/**
 * Sets the authordata global when viewing an author archive.
 *
 * This provides backwards compatibility with
 * http://core.trac.wordpress.org/changeset/25574
 *
 * It removes the need to call the_post() and rewind_posts() in an author
 * template to print information about the author.
 *
 * @global WP_Query $wp_query WordPress Query object.
 * @return void
 */
function levelup_setup_author() {
	global $wp_query;

	if ( $wp_query->is_author() && isset( $wp_query->post ) ) {
		$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
	}
}
add_action( 'wp', 'levelup_setup_author' );

Zerion Mini Shell 1.0