Skip to content

Instantly share code, notes, and snippets.

View ahmedkaludi's full-sized avatar
🎯
Focusing

Ahmed Kaludi ahmedkaludi

🎯
Focusing
View GitHub Profile
#text-2 { /* change it to the proper widget id */
background: none;
border: 0;
padding: 0;
}
@ahmedkaludi
ahmedkaludi / Retina Sprites
Last active June 6, 2016 01:23
Sample markup for the tutorial on Retina Sprites at http://ahmedkaludi.com/retina-sprites/
<div class="candy">
<ul>
<li class="candyicons facebook"><a href="#"></a></li>
<li class="candyicons instagram"><a href="#"></a></li>
<li class="candyicons medium"><a href="#"></a></li>
<li class="candyicons snapchat"><a href="#"></a></li>
<li class="candyicons twitter"><a href="#"></a></li>
<li class="candyicons youtube"><a href="#"></a></li>
</ul>
</div>
@ahmedkaludi
ahmedkaludi / Retina Sprites Css markup
Last active June 6, 2016 01:24
Sample markup for the tutorial on Retina Sprites at http://ahmedkaludi.com/retina-sprites/
.candy ul{
list-style-type: none
}
.candy ul li{
display: inline;
list-style-type: none
}
.candy .candyicons a{
background: url(http://ahmedkaludi.com/wp-content/uploads/2016/06/retina-sprite-optimized.png) no-repeat;
/* Original Image size was 36kb. After optimizing it with TinyPng, the size went down to 12kb */
@ahmedkaludi
ahmedkaludi / WordPress Sample Loop.php
Last active May 5, 2019 10:52
WordPress Sample Loop
<?php
// checks if there are any posts that match the query
if ( have_posts() ) :
// If there are posts matching the query then start the loop
while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>">
<!-- 1. Title Start -->
@ahmedkaludi
ahmedkaludi / WordPress Loop with Google Structured Data.php
Created June 12, 2016 10:53
WordPress Loop with Google Structured Data
<?php
// checks if there are any posts that match the query
if ( have_posts() ) :
// If there are posts matching the query then start the loop
while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" role="article" itemprop="hasPart" itemscope="" itemtype="http://schema.org/Article">
<meta itemscope='itemscope' itemprop='mainEntityOfPage' itemType='https://schema.org/WebPage'/>
@ahmedkaludi
ahmedkaludi / Structured data in Divi theme.php
Created June 19, 2016 14:22
Structured data in Divi theme
<?php
add_action( 'wp_enqueue_scripts', 'ahmedkaludi_enqueue_styles' );
function ahmedkaludi_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
// Display Tag code
function ahmedkaludi_structured_data_keyword() {
if ( is_single() ) {
@ahmedkaludi
ahmedkaludi / Structured Data in WordPress
Created June 19, 2016 16:01
Structured Data in WordPress
// Display Tag code
function ahmedkaludi_structured_data_keyword() {
if ( is_single() ) {
$tags = '"keywords" : [' . strip_tags(get_the_tag_list('"','", "','"')) . ']';
} else { }
echo $tags;
}
function ahmedkaludi_structured_data_output() {
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"description": "0.7 cubic feet countertop microwave. Has six preset cooking categories and convenience features like Add-A-Minute and Child Lock.",
"name": "Kenmore White 17\" Microwave",
"offers": {
"@type": "Offer",
"price": "55.00",
"priceCurrency": "USD"
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"description": "0.7 cubic feet countertop microwave. Has six preset cooking categories and convenience features like Add-A-Minute and Child Lock.",
"name": "Kenmore White 17\" Microwave",
"offers": {
"@type": "Offer",
"availability": "http://schema.org/InStock",
"price": "55.00",
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "3.5",
"reviewCount": "11"
},
"description": "0.7 cubic feet countertop microwave. Has six preset cooking categories and convenience features like Add-A-Minute and Child Lock.",