Skip to content

Instantly share code, notes, and snippets.

View anwerashif's full-sized avatar
🚩
Coding

Anwer Ashif anwerashif

🚩
Coding
View GitHub Profile
@anwerashif
anwerashif / functions.php
Created November 3, 2017 18:39
Display custom logo to Genesis Framework
<?php
// Do NOT include the opening PHP tag
// Display custom logo
add_action( 'genesis_site_title', 'the_custom_logo', 0 );
@anwerashif
anwerashif / functions.php
Created November 3, 2017 18:57
Remove title/logo metabox from Genesis theme options page
<?php
// Do NOT include the opening PHP tag
/* Remove title/logo metabox from Genesis theme options page
* See http://www.billerickson.net/code/remove-metaboxes-from-genesis-theme-settings/
* Updated to use $_genesis_admin_settings instead of legacy variable in Bill's example.
*/
add_action( 'genesis_theme_settings_metaboxes', 'be_remove_metaboxes' );
function be_remove_metaboxes( $_genesis_admin_settings ) {
remove_meta_box( 'genesis-theme-settings-header', $_genesis_admin_settings, 'main' );
@anwerashif
anwerashif / style.css
Created November 3, 2017 19:17
Add CSS for Custom Logo
/*
* Custom Logo Sytle
*/
.wp-custom-logo .site-title {
position: absolute!important;
clip: rect(0,0,0,0);
height: 0;
width: 0;
border: 0;
@anwerashif
anwerashif / functions.php
Created November 3, 2017 19:19
Add Custom Logo to Genesis Child Theme
<?php
// Do NOT add the opening PHP tag
// Add custom logo or Enable option in Customizer > Site Identity
add_theme_support( 'custom-logo', array(
'width' => 244,
'height' => 315,
'flex-width' => true,
'flex-height' => true,
'header-text' => array( '.site-title', '.site-description' ),
@anwerashif
anwerashif / functions.php
Last active November 4, 2017 19:38
Remove title/logo metabox from Genesis customizer
<?php
// Do NOT include the opening PHP tag
/*
* Remove title/logo metabox from Genesis customizer
* See https://developer.wordpress.org/themes/advanced-topics/customizer-api/
*/
add_action( 'customize_register', 'es_theme_customize_register', 99 ); // Priority had to be last for this to work
function es_theme_customize_register( $wp_customize ) {
$wp_customize->remove_control('blog_title');
@anwerashif
anwerashif / functions.php
Created November 5, 2017 15:54
Remove Post Meta From Blog Posts Page
<?php
// Do NOT include the opening PHP tag
// Remove Post Meta From Blog Posts Page
add_filter( 'genesis_post_meta', 'remove_post_meta_home_page' );
function remove_post_meta_home_page($post_meta) {
if ( is_home() ) {
$post_meta = '';
return $post_meta;
}}
@anwerashif
anwerashif / functions.php
Created November 5, 2017 15:57
Remove Post Info From Blog Posts Page
<?php
// Do NOT include the opening PHP tag
// Remove Post Info From Blog Posts Page
add_filter( 'genesis_post_info', 'remove_post_info_home_page' );
function remove_post_info_home_page($post_info) {
if ( is_home() ) {
$post_info = '';
return $post_info;
}}
@anwerashif
anwerashif / functions.php
Created November 5, 2017 16:21
Modify Genesis Next & Previous Page Link Text
<?php
// Do NOT include the opening PHP tag
// Modify Genesis Next & Previous Page Link Text
add_filter( 'genesis_prev_link_text', 'modify_previous_link_text' );
function modify_previous_link_text($text) {
$text = '« Newer Entries';
return $text;
}
/**
@anwerashif
anwerashif / functions.php
Created November 5, 2017 17:28
Customize the Genesis content limit read more link
<?php
// Do NOT include the opening PHP tag
// Customize the Genesis content limit read more link
add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
function sp_read_more_link() {
return '<p class="more-link">Continue reading » <a href="' . get_permalink() . '">' . get_the_title() . '</a></p>';
}
@anwerashif
anwerashif / functions.php
Created November 6, 2017 19:19
Add .php Extension to WordPress Page Permalinks
<?php
// Do NOT include the opening PHP tag
// Add .PHP to page permalinks
add_action('init', 'ss_php_pages', -1);
function ss_php_pages() {
global $wp_rewrite;
if ( !strpos($wp_rewrite->get_page_permastruct(), '.php')){
$wp_rewrite->page_structure = $wp_rewrite->page_structure . '.php';