Skip to content

Instantly share code, notes, and snippets.

View mohandere's full-sized avatar
🎯
Focusing

Mohan Dere mohandere

🎯
Focusing
View GitHub Profile
@mohandere
mohandere / yoast-seo-sitemap.php
Last active February 4, 2024 04:58
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index
@mohandere
mohandere / blogFactory.js
Last active August 29, 2015 14:16
Angular Factory/Service for Interaction with Wordpress Blog
function fzBlogFactory($http, $sce, config) {
function allPosts() {
return httpRequest('posts?filter[category_name]=post');
}
function postByID(id) {
return httpRequest('posts/' + id);
}
function featuredPosts() {
@mohandere
mohandere / wp-auto-installer.js
Last active November 5, 2023 19:10
Wordpress auto installer script PHP
;(function($){
/*
Script Name: WP Auto Installer
Author: Mohan Dere
Version: 1.0
Description : This script install new wordpress setup, create database with tables with content & run search replace database for new urls.
Last Update: 13 Mar 15
*/
@mohandere
mohandere / get-isotope-items.php
Last active March 6, 2024 14:20
jQuery isotope plugin for wordpress posts filtering by category with pagination.
<?php
function get_isotope_item( $query_args = array() ){
$defaults = array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
);
@mohandere
mohandere / child.js
Last active June 9, 2020 03:39
Iframe height issue - make iframe height dynamic based on content inside
(function(){
'use-strict';
/**
* Iframe to Parent window communication
* sample iframe- <iframe id="guestFrame" name="guestFrame" src="http://other-domain.com/">
* </iframe>
* Uses https://ternarylabs.github.io/porthole/
* Uses https://marcj.github.io/css-element-queries/
@mohandere
mohandere / app.js
Last active August 23, 2016 13:57
i18n with polyglot.js and rendr.js
var patches = require('./lib/patches')
, BaseApp = require('rendr/shared/app')
, handlebarsHelpers = require('./lib/handlebarsHelpers')
, Polyglot = require('node-polyglot')
, _ = require('underscore');
/**
* setup constants/globals
*/
@mohandere
mohandere / templateManager.js
Created October 18, 2016 17:39
Template Manager plugin for Loading HBS template files:
/*
templateManager - Async Handlebars template loader/cacher.
@author Mohan Dere
@version 1.0
@requires jQuery || zepto, underscore, Handlebars.js
*/
(function() {
@mohandere
mohandere / app.js
Last active May 19, 2017 17:29
React-todo
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
import { Grid, Row, Col, PageHeader } from 'react-bootstrap';
import './App.css';
import Home from './components/Home';
import About from './components/About';
class App extends Component {
@mohandere
mohandere / FilesLoader-Usage.js
Created June 21, 2017 12:21
Asynchronous files loading with jquery deferred with callback
//Usage
var tplsToLoad = [
'tpl/menu-section',
'tpl/header',
'tpl/footer'
];
window.FilesLoader.load(tplsToLoad,
function () {
@mohandere
mohandere / App.js
Last active January 28, 2021 09:24
React js Responsive Gallery with Masonry Layout and Lightbox
import React, {
Component
} from 'react';
//Import responsive gallery component
import ResponseiveGallery from './components/ResponsiveGallery';
// Define array of images with thumbnails
const DEFAULT_IMAGES = [{
src: '/images/gallery-1.jpg',
thumbnail: '/images/gallery-1.jpg',