Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SMOF(syamilmj/Options-Framework) কে shortcode আকারে ব্যবহার করে background change করা | এবং shortcode এ default data দেখান |
- // we have to show into admin>functions>functions.options.php
- /*background image changing by SMOF single shortcode*/
- function using_bg_shortcode($atts , $content=null){
- extract(shortcode_atts(array(
- ),$atts));
- global $data;
- if($data['click_share_bg']):
- return '<style type="text/css">
- .click_share{background-image:url('.$data['click_share_bg'].'); background-repeat:no-repeat scroll center center;background-size:100% 100%;}
- </style>';
- else:
- return '<style type="text/css">.click_share{background-image:url('.get_stylesheet_directory_uri().'/images/clickbg.jpg); background-repeat:no-repeat scroll center center;background-size:100% 100%;}</style>';
- endif;
- }
- add_shortcode('bg', 'using_bg_shortcode');
- // here is my shortcode
- <?php echo do_shortcode('[bg]');?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement