Skip to content

Instantly share code, notes, and snippets.

:octocat:
Finalizing

Juyal Ahmed tojibon

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 / 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-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-featured-image-upload-for-front-end.php
Last active Feb 21, 2018
Upload featured image on custom post from WordPress front-end
View wp-featured-image-upload-for-front-end.php
@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-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' ) ) {
@tojibon
tojibon / functions.php
Last active Aug 29, 2015
WordPress child theme stylesheets enqueue
View functions.php
add_action( 'wp_enqueue_scripts', 'mondira_child_theme_css' );
function mondira_child_theme_css() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
}
You can’t perform that action at this time.