Skip to content

Instantly share code, notes, and snippets.

View dancywritter's full-sized avatar
🏠
Working from home

Haroon Rasheed dancywritter

🏠
Working from home
View GitHub Profile
@dancywritter
dancywritter / html_for_international_calling coes.htm
Created June 11, 2019 19:52 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@dancywritter
dancywritter / Readme.txt
Created June 15, 2019 06:49 — forked from vishalbasnet23/Readme.txt
Custom Activation Link on Sign Up WordPress
Step by step guide.
First Phase:
1.First create a html form with first name, last name and email field for signing up process.( Remember the action of the form it has to be the page slug of email confirmation page that you will be creating at in next phase. )
Second Phase :
1.Create a Page ( Remember the slug has to be the same of that of action of the form of phase one ) and assign the template template-confirmation-mail.php
2.This page is responsible for generating unqiue hash key and sending that hash key along with the user's new account credentials to their email.
3.Remember the link of the activation_link has to the link to the email-verification template, which we will be creating in next phase.
Third Phase :
1. Create a page and assign it to Email Verification Template.( Remember this template has to be assigned to the page that you sent in the mail in previous step )
2. This page is responsilble matching that unqiue key sent on the email once new user visit that page.
@dancywritter
dancywritter / user-profile-picture.php
Created June 17, 2019 17:19 — forked from spigotdesign/user-profile-picture.php
Add WordPress image uploader to user profile.
/*
* Add custom user profile information
*
*/
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
@dancywritter
dancywritter / duplicate-title-checker.php
Created June 11, 2020 07:59 — forked from certainlyakey/duplicate-title-checker.php
Wordpress Duplicate Title Checker plugin (updated version)
<?php
/*
Plugin Name: Duplicate Title Checker (zip all related files to upload it)
Plugin URI: http://wordpress.org/extend/plugins/duplicate-title-checker/
Description: This plugin provides alert message for duplicate post title and unique post title when adding new post.
Author: Ketan Ajani, improved by fuchsws and certainlyakey (see http://wordpress.org/support/topic/suggestions-35?replies=2)
Version: 1.1
Author URI: http://www.webconfines.com
*/
@dancywritter
dancywritter / Simple Ajax Login Form.php
Created July 22, 2020 11:35 — forked from cristianstan/Simple Ajax Login Form.php
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
@dancywritter
dancywritter / alanStudio.js
Created August 5, 2020 20:45 — forked from adrianhajdin/alanStudio.js
Alan Studio Code Materials
intent('What does this app do?', 'What can I do here?',
reply('This is a news project.'));
const API_KEY = '7bdfb1b10aca41c6becea47611b7c35a';
let savedArticles = [];
// News by Source
intent('Give me the news from $(source* (.*))', (p) => {
let NEWS_API_URL = `https://newsapi.org/v2/top-headlines?apiKey=${API_KEY}`;
@dancywritter
dancywritter / youtube_id_regex.php
Created August 8, 2020 11:18 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@dancywritter
dancywritter / add-nav-parent-count.php
Created August 25, 2020 16:36 — forked from jessepearson/add-nav-parent-count.php
Functions to add a parent count to WordPress nav menus. This is useful if you need to change nav element size based on the number of parent/top level elements.
<?php
/**
* Gets the count of the parent items in a nav menu based upon the id specified.
*
* @param string $nav_id The id of the nav item to get the parent count for.
* @return bool|int False on fail, or the count of how many parent items there are.
* @uses wp_get_nav_menu_items
*/
function count_nav_parent_items( $nav_id = null ) {
@dancywritter
dancywritter / functions.php
Created October 14, 2020 19:56 — forked from mustardBees/functions.php
Filter a few parameters into WordPress YouTube oEmbed requests. Enable modest branding which hides the YouTube logo. Remove the video title and uploader information. Prevent related videos from being shown once the video has played.
<?php
/**
* Filter a few parameters into YouTube oEmbed requests
*
* @link http://goo.gl/yl5D3
*/
function iweb_modest_youtube_player( $html, $url, $args ) {
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html );
}
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 );
@dancywritter
dancywritter / Sitemap.xml
Created October 20, 2020 10:31 — forked from misterebs/Sitemap.xml
Create sitemap.xml for wordpress site without plugins
Copy this code to function.php
//Sitemap XML
/*
function to create sitemap.xml file in root directory of site
*/