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($) { | |
/* |
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; /* |
View wp-featured-image-upload-for-front-end.php
<?php | |
//Just uploading photo or attachments | |
require_once(ABSPATH . "wp-admin" . '/includes/image.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/file.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/media.php'); | |
$file_handler = 'upload_attachment' //Form attachment Field name. | |
$attach_id = media_handle_upload( $file_handler, $post_id ); |
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 | |
*/ |
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"; | |
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 ) { |
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; |
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' ) ); | |
} |
OlderNewer