chief_wolfinjo Posted July 16, 2012 Share Posted July 16, 2012 Hi, I installed Nivo slider in functions.php of Wordpress using this code please look at pastebin http://pastebin.com/1HxfQGvu and it is working but now i want to add options for Nivo slider in admin panel of Wordpress and i dont know how to that here you can see what options can be used : <script type="text/javascript"> $(window).load(function() { $('#slider').nivoSlider({ effect: 'random', // Specify sets like: 'fold,fade,sliceDown' slices: 15, // For slice animations boxCols: 8, // For box animations boxRows: 4, // For box animations animSpeed: 500, // Slide transition speed pauseTime: 3000, // How long each slide will show startSlide: 0, // Set starting Slide (0 index) directionNav: true, // Next & Prev navigation directionNavHide: true, // Only show on hover controlNav: true, // 1,2,3... navigation controlNavThumbs: false, // Use thumbnails for Control Nav pauseOnHover: true, // Stop animation while hovering manualAdvance: false, // Force manual transitions prevText: 'Prev', // Prev directionNav text nextText: 'Next', // Next directionNav text randomStart: false, // Start on a random slide beforeChange: function(){}, // Triggers before a slide transition afterChange: function(){}, // Triggers after a slide transition slideshowEnd: function(){}, // Triggers after all slides have been shown lastSlide: function(){}, // Triggers when last slide is shown afterLoad: function(){} // Triggers when slider has loaded }); }); </script> You can see the rest at the bottom of the page here http://nivo.dev7studios.com/support/jquery-plugin-usage/ Please can you tell me what code should i use in functions.php of Wordpress to have ability to have options in admin panel of Wordpress for Nivo slider ? Thank you !!!! Quote Link to comment https://forums.phpfreaks.com/topic/265743-wordpress-nivo-slider-need-help/ Share on other sites More sharing options...
Mahngiel Posted July 16, 2012 Share Posted July 16, 2012 (Spoken from a non-WP user) You can't :specifically: control javascript through PHP implementation like you're asking. The only thing you could do to is create a table in your database and an admin form that sets values for the settings. Then, where you call your settings, you can echo the PHP $NivoSettings = //database query; $('#slider').nivoSlider({ effect: <?php echo $NivoSettings->effect; ?>, // Specify sets like: 'fold,fade,sliceDown' slices: <?php echo $NivoSettings->slices; ?>, // For slice animations ... Quote Link to comment https://forums.phpfreaks.com/topic/265743-wordpress-nivo-slider-need-help/#findComment-1361930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.