Skip to content

Instantly share code, notes, and snippets.

View rushijagani's full-sized avatar
🏠
Working | Exploring | Accelerating from home

Rushi Jagani rushijagani

🏠
Working | Exploring | Accelerating from home
View GitHub Profile
@rushijagani
rushijagani / Custom CSS
Last active August 31, 2017 12:38
Custom Logo CSS
.site-logo-img .custom-logo-link img {
max-height: 120px;
width: auto;
}
@rushijagani
rushijagani / debug-vl.php
Created September 13, 2017 05:40
Function for Developers to debug the PHP code (var_dump/print_r)
if ( ! function_exists( 'vl' ) ) :
/**
* Replacement for print_r & var_dump.
*
* @param mixed $var
* @param bool $dump. (default: false)
*/
function vl( $var, $dump = 0 ) {
?>
@rushijagani
rushijagani / footer-style.css
Created March 22, 2018 06:05
Astra Responsive Footer ( Layout - 6 ) CSS
@rushijagani
rushijagani / functions.php
Created March 26, 2018 11:27
Level Creative Theme
<?php
/**
* Level Creativ Theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Level Creativ
* @since 1.0.0
*/
@rushijagani
rushijagani / code-snippet.php
Last active October 28, 2020 00:57
Update default strings from Astra
<?php
// Change Default String.
function default_strings_callback( $strings ) {
$strings['string-comment-title-reply'] = __( 'Hozzászólás', 'astra' );
$strings['string-comment-label-submit'] = __( 'Elküldés &raquo;', 'astra' );
$strings['string-comment-label-message'] = __( 'Ide írj..', 'astra' );
$strings['string-single-navigation-next'] = __( 'következő %s', 'astra' ) . ' <span class="ast-right-arrow">&rarr;</span>';
$strings['string-single-navigation-previous'] = '<span class="ast-left-arrow">&larr;</span> ' . __( 'előző %s', 'astra' );
$strings['string-blog-meta-author-by'] = __( 'írta', 'astra' );
@rushijagani
rushijagani / style.css
Created April 18, 2018 12:10
Anchor tag inside headings hover color.
.entry-content h1 a:hover,
.entry-content h2 a:hover,
.entry-content h3 a:hover,
.entry-content h4 a:hover,
.entry-content h5 a:hover,
.entry-content h6 a:hover{
color:#ffc054;
}
@rushijagani
rushijagani / functions.php
Created April 18, 2018 14:06
Remove `href` from Site Title & Site Logo
<?php
// Remove `href` from Site Title & Site Logo.
add_action( 'wp', 'remove_link_from_site_title_logo', 5 );
function remove_link_from_site_title_logo(){
remove_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
add_filter( 'home_url', 'astra_logo_custom_url' );
add_action( 'astra_masthead_content', 'astra_site_branding_markup', 8 );
add_action('astra_masthead_content','astra_remove_logo_custom_url',9);
}
function astra_logo_custom_url( $url ) {
@rushijagani
rushijagani / menu-description-filter.php
Created April 25, 2018 12:33
Menu Description Filter
<?php
// Add below filter to display Menu Descripiton in child theme's functions.php file.
function prefix_nav_description( $item_output, $item, $depth, $args ) {
if ( !empty( $item->description ) ) {
$item_output = str_replace( $args->link_after . '</a>', '<span class="menu-item-description">' . $item->description . '</span>' . $args->link_after . '</a>', $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'prefix_nav_description', 10, 4 );
@rushijagani
rushijagani / functions.php
Created April 30, 2018 06:20
Custom post type static titles.
<?php>
/**
* Static page header title on case-study post types
*/
add_filter( 'astra_advanced_header_title', 'page_header_case_study_title' );
function page_header_case_study_title( $title ) {
// Add your condition where you want to update the Page Header title.
if ( is_singular( array( 'case-study' ) ) ) {
@rushijagani
rushijagani / functions.php
Created May 2, 2018 05:47
Custom Post Type Container, Sidebar Layout same as Blog Post Single.
<?php
add_filter( 'astra_get_content_layout', 'custom_post_type_content_layout');
// Update the container layout for Custom Post Type same as Blog Post.
function custom_post_type_content_layout ( $layout ){
$single_post = astra_get_option( 'single-post-content-layout' );
// Add your CPT instead of newspaper, book. If it's only for one CPT then add just one CPT.
if ( is_singular( array( 'newspaper, book') ) ) {
$layout = $single_post;
}