This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// randomize upload filenames | |
function htg_randomize_uploaded_filename( $filename ) { | |
// does it have an extension? grab it | |
$ext = empty( pathinfo( $filename )['extension'] ) ? '' : '.' . pathinfo( $filename )['extension']; | |
// return the first 8 characters of the MD5 hash of the name, along with the extension | |
return substr(md5($filename), 0, 8) . $ext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function __block_caps( $caps, $cap ) { | |
if ( $cap === 'install_themes' ) | |
$caps[] = 'do_not_allow'; | |
return $caps; | |
} | |
add_filter( 'map_meta_cap', '__block_caps', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function remove_wp_logo( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'wp-logo' ); | |
} | |
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RTL Support | |
function enqueue_theme_files() { | |
wp_enqueue_style( 'themeslug-style', get_stylesheet_uri() ); | |
wp_style_add_data( 'themeslug-style', 'rtl', 'replace' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'enqueue_theme_files' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//for each category, show all posts | |
$cat_args=array( | |
'orderby' => 'name', | |
'order' => 'ASC' | |
); | |
$categories=get_categories($cat_args); | |
foreach($categories as $category) { | |
$args=array( | |
'showposts' => -1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: Your Theme Name | |
Theme URI: https://www.your-site.com/ | |
Description: The 2021 default theme for WordPress. | |
Author: Abdulrhman Ahmed | |
Author URI: https://www.aboelsaad.com/ | |
Version: 1.0 | |
Tags: blue, white, two-columns, translation-ready, rtl-language-support, custom-menu (optional) | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
OlderNewer