Skip to content

Instantly share code, notes, and snippets.

View arvindsvt's full-sized avatar

Arvind Shrivastwa arvindsvt

  • Ahmedabad
View GitHub Profile
@arvindsvt
arvindsvt / functions.php
Created December 7, 2019 12:33 — forked from vivek-kumar-poddar/functions.php
This is an updated version of social media buttons. This code snippet will help you to add social media buttons to your website without even using any plugin. Furthermore it's javascript free. Enjoy fast speed and the same usability. For more details visit the official post: https://wpvkp.com/add-social-media-sharing-buttons-to-wordpress-without…
// Function to handle the thumbnail request
function get_the_post_thumbnail_src($img)
{
return (preg_match('~\bsrc="([^"]++)"~', $img, $matches)) ? $matches[1] : '';
}
function wpvkp_social_buttons($content) {
global $post;
if(is_singular() || is_home()){
// Get current page URL
@arvindsvt
arvindsvt / DoublyLinkedList.c
Created June 22, 2019 03:07 — forked from mycodeschool/DoublyLinkedList.c
Doubly Linked List implementation in C
/* Doubly Linked List implementation */
#include<stdio.h>
#include<stdlib.h>
struct Node {
int data;
struct Node* next;
struct Node* prev;
};
By https://pastebin.com/S0UCDUYi
https://github.com/twittem/wp-bootstrap-navwalker
OR
functions.php
#............................................................................................
<?php
@arvindsvt
arvindsvt / bootstrap-walker-menu.php
Created March 17, 2018 16:25 — forked from braginteractive/bootstrap-walker-menu.php
WordPress Walker Menu for Bootstrap
<?php
// Custom Walker Class for Bootstrap Menu
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"dropdown-menu\">\n";
}
@arvindsvt
arvindsvt / php-pdo-mysql-crud.md
Last active February 4, 2018 05:52 — forked from odan/php-pdo-mysql-crud.md
Basic CRUD operations with PDO and MySQL

Basic CRUD operations with PDO

CRUD = Create, Read, Update, Delete

Open a database connection

$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';