Skip to content

Instantly share code, notes, and snippets.

View abelsaad's full-sized avatar
😊

abdelrhman aboelsaad abelsaad

😊
View GitHub Profile
@abelsaad
abelsaad / breadcrumbs.css
Created May 18, 2021 13:28
Breadcrumbs Css
/*
=================
breadcrumbs
=================
*/
#breadcrumbs {
margin: 0;
padding: 20px 0;
}
@abelsaad
abelsaad / Post-tags.php
Created May 18, 2021 12:47
Add tags to your post
<!-- Default Usage -->
<?php the_tags(''); ?>
<!-- Separated by Commas -->
<?php the_tags( 'Tags: ', ', ', '<br />' ); ?>
<!-- Separated by Arrow -->
<?php the_tags( 'Social tagging: ',' > ' ); ?>
<!-- Separated by a Bullet -->
@abelsaad
abelsaad / post-date-time.php
Created May 18, 2021 12:42
Post date & time
<!-- Post time "9:20 am" -->
<?php the_time( 'g:i a' ); ?>
<!-- Displays the time in the date format ‘F j, Y’ (ex: May 16, 2021) -->
<?php the_time('F j, Y'); ?>
<!-- Ex: May 16, 2021 -->
<?php echo get_the_date( 'j F, Y' ); ?>
@abelsaad
abelsaad / site-information.php
Last active August 1, 2021 09:50
Site Informations
<?php bloginfo('name'); ?> - Site title
<?php bloginfo('description'); ?> - Site description
<?php bloginfo('url'); ?> - Site Home URL
<?php bloginfo('rss2_url'); ?> - RSS URL
<?php bloginfo('template_url'); ?> - Theme URL
<?php bloginfo('template_directory'); ?> - Theme directory
<?php bloginfo('pingback_url'); ?> - Pingback URL
<?php bloginfo('stylesheet_url'); ?> - Style file URL
<?php bloginfo('wpurl'); ?> - Site URL
<?php include TEMPLATEPATH . '/searchform.php'; ?> - Include Search Form
@abelsaad
abelsaad / display-menu.php
Created May 18, 2021 12:25
Display Menu anywhere
<?php
$defaults = array(
'theme_location' => 'menu_main', // Change This to your id
'container_id' => 'site_main', // Custom Id, you can add your own
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'items_wrap' => '<ul id="menu-main" class="navbar-right">%3$s</ul>',
'depth' => 0,
);
@abelsaad
abelsaad / functions.php
Created May 18, 2021 12:15
Support Menu
<?php
// Support Menus
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'menu_main' => 'Main Menu',
'mobile_menu' => 'Mobile Menu',
'footer_menu' => 'Footer Menu',
)
@abelsaad
abelsaad / header.php
Last active March 14, 2022 09:22
Head content inside header
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?php if(is_front_page() || is_home()){ echo get_bloginfo('name') . ' | ' . get_bloginfo( 'description' ); } else { wp_title(''); echo ' | '; bloginfo( 'name' ); }?></title>
<link rel="pingback" href="<?php bloginfo('pingback url'); ?>" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
@abelsaad
abelsaad / include-files.php
Created May 18, 2021 12:06
Including Files
<!-- Header -->
<?php get_header(); ?>
<!-- Sidebar -->
<?php get_sidebar(); ?>
<!-- Footer -->
<?php get_footer(); ?>
<!-- Comments -->
@abelsaad
abelsaad / Style.css
Created May 18, 2021 12:01
Theme Stylesheet
/*
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