Skip to content

Instantly share code, notes, and snippets.

:octocat:
Finalizing

Juyal Ahmed tojibon

:octocat:
Finalizing
Block or report user

Report or block tojibon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tojibon
tojibon / proxy.js
Last active Aug 26, 2015
CasperJS script to test proxy ip address using http://ip-addr.es/
View proxy.js
var casper = require('casper').create();
casper.start('http://ip-addr.es/', function() {
var doc = this.evaluate(function() {
return document;
});
this.echo(doc.all[0].outerText);
});
casper.run();
@tojibon
tojibon / custom.js
Created Aug 28, 2015
Bootstrap inactive broken content for inactive tabs on page load fix
View custom.js
jQuery(document).ready(function ($) {
$('.nav-tabs li a').on('shown.bs.tab', function (e) {
$('.tab-pane').resize();
Calendar.init(); //Reinit JS codes
});
});
@tojibon
tojibon / wp-admin-page-template-selection.js
Last active Aug 29, 2015
Loading Show/Hide different settings meta block for Page, Post, Post Type (i.e : Portfolio) when page template changed on WordPress admin by a Javascript which is loaded for admin
View wp-admin-page-template-selection.js
/*
---------------------------------------------------------------------------------------
Loading different settings meta block for Page, Post, Portfolio when page template changed on WordPress admin
---------------------------------------------------------------------------------------
*/
jQuery(document).ready( function($) {
/*
@tojibon
tojibon / wp-replace-post-image-uri.php
Last active Aug 29, 2015
Replacing media urls on WordPress
View wp-replace-post-image-uri.php
<?php
/*
When you are done with all development and uploaded all contents on a development setup that means all media files and
contents media urls are targeting with http://www.example.com/dev your development site.
You can replace all resource and post links to your live site with below written codes in php.
You just need to execute the code with wp query.
Author: Jewel Ahmed
Author Url: http:www.codeatomic.com
*/
@tojibon
tojibon / wp-unique-page-sidebar-autofill.js
Last active Aug 29, 2015
Auto fill input values for WordPress Unique Page Sidebars [Plugins] when creating a dynamic sidebar with default values
View wp-unique-page-sidebar-autofill.js
/*
---------------------------------------------------------------------------------------
Auto fill input values for WordPress Unique Page Sidebars [Plugins] when creating a dynamic sidebar with default values
---------------------------------------------------------------------------------------
*/
jQuery(document).ready( function($) {
//Finding all inputs from unique page sidebars when creating a sidebar
$("input[id^=ups_sidebars]").each( function( k, v ) {
@tojibon
tojibon / wp-contact-form-7-style.css
Last active Aug 29, 2015
WordPress Contact form 7 [Plugins] Nice css3 styles
View wp-contact-form-7-style.css
/*Contact Form 7 CSS Support*/
span.wpcf7-not-valid-tip{display: none !important; }
div.wpcf7 .wpcf7-not-valid{ border: 1px solid #F00; margin: 0; }
div.wpcf7-validation-errors{ -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /* Opera/IE 8+ */ margin: 0; padding: 10px; color: #c4690e; background: #fffdf3; text-align: center; border: 1px solid #e6bf4a; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; font-size: 12px;}
div.wpcf7 .wpcf7-not-valid { box-shadow: 0 0 6px rgba(255,0,0,0.4); }
.your-message textarea{ width:100%; -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /* Opera/IE 8+ */ }
div.wpcf7-mail-sent-ok { -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /*
@tojibon
tojibon / wp-open-graph.php
Last active Aug 29, 2015
Adding Open Graph Content on WordPress
View wp-open-graph.php
<?php
if ( !function_exists( 'mondira_add_opengraph' ) ) {
function mondira_add_opengraph() {
global $post;
if ( empty( $post ) ) {
return "";
}
echo "\n<!-- " . get_bloginfo( 'name' ) . " Open Graph Tags -->\n";
@tojibon
tojibon / get_previous_next_post.php
Last active Aug 29, 2015
If you are using menu order for CTP post index and viewing single then you can use this snippets to get the right post link for next/prev.
View get_previous_next_post.php
<?php
function mondira_previous_post_where( $in_same_term, $excluded_terms ) {
global $post, $wpdb;
if ( get_post_type( $post ) == 'portfolio' ) {
return $wpdb->prepare( "WHERE p.menu_order < %s AND p.post_type = %s AND p.post_status = 'publish' $posts_in_ex_terms_sql", $post->menu_order, $post->post_type);
}
}
add_filter( 'get_previous_post_where', 'mondira_previous_post_where', 10, 2 );
function mondira_next_post_where( $in_same_term, $excluded_terms ) {
@tojibon
tojibon / gist:aefa3f66bf1c83fc74b9
Last active Aug 29, 2015
wordpress-tb-menu.php
View gist:aefa3f66bf1c83fc74b9
<?php
/*
*
* WordPress menu building THIS IS valid till you have a menu created by admin.
*
* Author: Jewel Ahmed
* Author Web: http://codeatomic.com
* Last Updated: 09 Nov, 2014
*/
$has_enabled_main_menu = false;
@tojibon
tojibon / tb-wp-menu-walker.php
Last active Aug 29, 2015
Twitter Botstrap Dropdown Navigation vs WordPress
View tb-wp-menu-walker.php
<?php
/*
*
* Adding bootstrap support on menu items by menu walker.
*
* @Author: Jewel Ahmed
* @Author Web: http://codeatomic.com
* @Last Updated: 14 Oct, 2014
*/
if ( !class_exists( 'Mondira_Bootstrap_Walker' ) ) {
You can’t perform that action at this time.