Permalink
Browse files

Initial Commit

  • Loading branch information...
bryceadams committed Nov 8, 2012
1 parent 0185a29 commit 62c5c28a7e46df5d52c79201d36fee53c8c1680f
View
109 README.md
@@ -1,4 +1,111 @@
Captain-Slider
==============
-Probably the best free slider plugin around
+* **Contributors:** captaintheme, bryceadams123
+* **Donate link:** http://captaintheme.com/
+* **Tags:** captain theme, captain slider, slider, jquery slider, responsive slider, slideshow, video slider, mobile slider, flexslider
+* **Requires at least:** 3.3
+* **Tested up to:** 3.5
+* **Stable tag:** trunk
+* **License:** GPLv2 or later
+
+> Probably the Best Free jQuery Slider/Slideshow Plugin for Wordpress. Responsive, Settings & Multiple Sliders!
+
+## Description
+
+This is the Slider Plugin I always wished I had. Simply install the plugin, add some slides & use your slider! It's that easy.
+
+**Features:**
+
+* Plenty of Settings like animation, speed, etc.
+* Multiple Sliders
+* Slider Sorter: Order your slides using drag & drop AJAX.
+* Responsive
+* Video Slides
+* Captions
+* Slide Links
+* Shortcode
+* Free
+
+**There are 2 ways to use your sliders:**
+
+* PHP - `<?php echo ctslider_slider_template( $id ); ?>`
+* Shortcode - `[slider id=""]`
+
+**Credits:**
+
+* Made by [Captain Theme](http://captaintheme.com/)
+* Uses [Flexslider](http://woothemes.com/flexslider/)
+
+**Documentation:**
+[Captain Slider Documentation](http://cpthe.me/sliderdocs)
+
+## Installation
+
+How to install this plugin?
+
+1. Search for "Captain Slider" in the Add New Plugin section of your site or download it and upload it manually.
+1. Install and activate the plugin.
+1. Create Slides under the new **Captain Slider** Menu.
+1. Use your Slider with either PHP or the Shortcode.
+1. Magic!
+
+## Frequently Asked Questions
+
+> **I’m getting the following error message when using PHP to display my slider (with all slides): Warning: Missing argument 1 for nextslider_slider_template(), called in etc. etc.**
+
+
Some hosting set-ups may have this issue. Just give it an empty parameter like so:
+
+```
+// All slides, with empty parameter set to stop warning from appearing
+<?php echo nextslider_slider_template(''); ?>
+```
+---
+
+> **My slider isn’t displaying the specific slider I want?**
+
+
Make sure that you’re stating the ID correctly like the examples above. Remember that you can find the slider ID under Slides > Sliders.
+
+---
+
+> **My slider’s just not displaying!**
+
+
If you’ve done everything else right and it’s still not displaying, you’re probably having a jQuery conflict with another plugin/theme. Try reverting back to the default Twenty Eleven or Twenty Twelve theme and disabling each plugin one by one.
+
+---
+
+> **Can I display multiple sliders on one page?**
+
+
+Why yes you can!
+
+---
+
+> **Which slider does Captain Slider use?**
+
+
Captain Slider proudly uses the lovely [Flex Slider](http://woothemes.com/flexslider/) by [WooThemes](http://woothemes.com/)
+
+---
+
+> **How can I say thanks Captain Theme?**
+
+How sweet of you. Anything from a small donation (made through the Captain Slider settings page) to a link to Captain Theme (http://captaintheme.com/) on your site helps!
+
+
+
+## Other Notes
+
+**Want to help?** Translate the Plugin! It's really easy using something like [the Codestyling Localization plugin](http://www.code-styling.de/english/development/wordpress-plugin-codestyling-localization-en), or an app like [Poedit](http://www.poedit.net/). You know what's even better? You get to help thousands of people! And I link to you! How good is that? Just [contact me](mailto:bryce@captaintheme.com) to talk about it. I'll even give you a present ;)
+
+
+
+##Changelog
+
+**Version 1.0.0 (07/11/2012):**
+
+* Initial Release.
+
+
+---
+
+###Found a bug? [Open an issue!](https://github.com/bryceadams/Captain-Slider/issues)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px"
+ height="32px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
+<g id="Layer_1">
+</g>
+<g id="move">
+ <g>
+ <polygon style="fill:#4E4E50;" points="18,20 18,26 22,26 16,32 10,26 14,26 14,20 "/>
+ <polygon style="fill:#4E4E50;" points="14,12 14,6 10,6 16,0 22,6 18,6 18,12 "/>
+ <polygon style="fill:#4E4E50;" points="12,18 6,18 6,22 0,16 6,10 6,14 12,14 "/>
+ <polygon style="fill:#4E4E50;" points="20,14 26,14 26,10 32,16 26,22 26,18 20,18 "/>
+ </g>
+</g>
+</svg>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px"
+ height="32px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
+<g id="Layer_1">
+</g>
+<g id="move_x5F_alt1">
+ <g>
+ <polygon style="fill:#4E4E50;" points="16,22 18,20 18,26 22,26 16,32 10,26 14,26 14,20 "/>
+ <polygon style="fill:#4E4E50;" points="16,10.062 14,12 14,6 10,6 16,0 22,6 18,6 18,12 "/>
+ <polygon style="fill:#4E4E50;" points="10,16 12,18 6,18 6,22 0,16 6,10 6,14 12,14 "/>
+ <polygon style="fill:#4E4E50;" points="21.938,16 20,14 26,14 26,10 32,16 26,22 26,18 20,18 "/>
+ </g>
+</g>
+</svg>
View
@@ -0,0 +1,171 @@
+<?php
+/*
+Plugin Name: Captain Slider
+Plugin URI: http://captaintheme.com/plugins/captain-slider/
+Description: Allows you to easily create multiple jQuery sliders.
+Author: Captain Theme
+Author URI: http://captaintheme.com
+Version: 1.0
+Text Domain: ctslider
+License: GNU GPL v2
+*/
+
+
+/*
+|--------------------------------------------------------------------------
+| CONSTANTS
+|--------------------------------------------------------------------------
+*/
+
+// Plugin Folder Path
+if( !defined( 'CTSLIDER_PLUGIN_DIR' ) ) {
+ define( 'CTSLIDER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
+}
+
+// Plugin Folder URL
+if ( ! defined( 'CTSLIDER_PLUGIN_URL' ) ) {
+ define( 'CTSLIDER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
+}
+
+/*
+|--------------------------------------------------------------------------
+| INCLUDES
+|--------------------------------------------------------------------------
+*/
+
+/*---------------------*/
+/* ADMIN
+/*---------------------*/
+
+// Slider Sorter
@sunnyratilal

sunnyratilal Nov 8, 2012

Contributor

You should put all of these in an if ( is_admin() ) block so they don't load on the front-end.

@bryceadams

bryceadams Nov 8, 2012

Owner

Ah good point, I forgot that's why I originally segregated everything haha

+include_once( CTSLIDER_PLUGIN_DIR . 'includes/admin/sorter.php' );
+
+// Register Some Settings
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/admin/settings.php' );
+
+// Slider's Post Type
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/admin/post-types.php' );
+
+// Slider's Taxonomies
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/admin/taxonomy.php' );
+
+// Slider's Metabox
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/admin/meta-box.php' );
+
+// Slider's User Interface
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/admin/ui.php' );
+
+
+/*---------------------*/
+/* FRONT END
+/*---------------------*/
+
+// Slider's Main Template
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/front-end/template.php' );
+
+// Slider's Shortcode
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/front-end/shortcode.php' );
+
+// Slider's Size
+include_once( CTSLIDER_PLUGIN_DIR . 'includes/front-end/custom-size.php' );
+
+
+
+/*
+|--------------------------------------------------------------------------
+| I18N - LOCALIZATION
+|--------------------------------------------------------------------------
+*/
+
+load_plugin_textdomain( 'ctslider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
+
+
+/*
+|--------------------------------------------------------------------------
+| SCRIPTS/STYLES
+|--------------------------------------------------------------------------
+*/
+
+function ctslider_load_scripts() {
+
@sunnyratilal

sunnyratilal Nov 8, 2012

Contributor

You should register all scripts then enqueue then. Not necessary at all but just a best practise.

@sunnyratilal

sunnyratilal Nov 8, 2012

Contributor

Also always put version numbers when loading styles and scripts. The reason being is that WordPress caches them and if you update them in a newer version but the version number is the same. WordPress won't update the cache unless you do a hard refresh.

We had the same problem in EDD with the new dashboard widget.

@bryceadams

bryceadams Nov 8, 2012

Owner

With the version should I just set the parameter to true or give it a specific version number? (probably same as the plugin version)

@bryceadams

bryceadams Nov 9, 2012

Owner

Just read Pippin's article on the subject, doing the define constant for version number thing

+ wp_enqueue_script( 'jquery' );
+
+ wp_enqueue_style( 'flex-style', CTSLIDER_PLUGIN_URL . 'css/flexslider.css' );
+
+ wp_enqueue_script( 'flex-script', CTSLIDER_PLUGIN_URL . 'js/jquery.flexslider-min.js', array( 'jquery' ), false, true );
+
+ wp_enqueue_script( 'fitvid', CTSLIDER_PLUGIN_URL . 'js/jquery.fitvids.js', array( 'jquery' ), false, true );
+
+}
+add_action('wp_enqueue_scripts', 'ctslider_load_scripts');
+
+
+// Admin Scripts/Styles
+function ctslider_load_admin_scripts($hook) {
+ global $post;
+ if( 'edit.php' == $hook && 'slides' == $post->post_type ) {
@sunnyratilal

sunnyratilal Nov 8, 2012

Contributor

Best to === rather than ==

+ wp_enqueue_style( 'admin-styles', CTSLIDER_PLUGIN_URL . 'css/admin-styles.css' );
+ }
+}
+add_action( 'admin_enqueue_scripts', 'ctslider_load_admin_scripts' );
+
+
+function ctslider_slider_load() {
+ $effect = ctslider_options_each('effect');
+ $automatic = ctslider_options_each( 'automatic' );
+ $controlnav = ctslider_options_each( 'bullets' );
+ $arrownav = ctslider_options_each( 'arrows' );
+ $slidespeed = ctslider_options_each( 'slidelength' );
+ $anispeed = ctslider_options_each( 'animationlength' ); ?>
+
+ <script type="text/javascript">
@sunnyratilal

sunnyratilal Nov 8, 2012

Contributor

Remember to send this through an output buffer.

+ /* Slider Parameters */
+ jQuery(window).load(function() {
+
+ jQuery(".flexslider")
+ .fitVids()
+ .flexslider({
+ animation: '<?php if ( $effect == 'fade' ) { echo 'fade'; } else { echo 'slide'; } ?>', // Specify sets like: 'fade' or 'slide'
+ direction: '<?php if ( $effect == 'slideh' ) { echo 'horizontal'; } else { echo 'vertical'; } ?>',
+ slideshow: <?php if ( $automatic == 1 ) { echo 'false'; } else { echo 'true'; } ?>,
+ controlNav: <?php if ( $controlnav == 1 ) { echo 'false'; } else { echo 'true'; } ?>,
+ directionNav: <?php if ( $arrownav == 1 ) { echo 'false'; } else { echo 'true'; } ?>,
+ slideshowSpeed: <?php echo $slidespeed; ?>,
+ animationSpeed: <?php echo $anispeed; ?>,
+ useCSS: false,
+ animationLoop: true,
+ smoothHeight: true,
+ //controlNav: "thumbnails"
+ });
+
+ });
+ </script>
+
+ <?php
+}
+add_action( 'wp_head', 'ctslider_slider_load' );
+
+
+/*
+|--------------------------------------------------------------------------
+| OTHER-FUNCTIONS
+|--------------------------------------------------------------------------
+*/
+
+/*****
+ * Add 'Settings' Link to Plugins Page
+**/
+
+function ctslider_settings_link($links, $file) {
+ static $this_plugin;
+
+ if (!$this_plugin) $this_plugin = plugin_basename(__FILE__);
+
+ if ($file == $this_plugin){
+ $settings_link = '<a href="edit.php?post_type=slides&page=ctslider_all_options">'.__("Settings", "eddslider").'</a>';
@sunnyratilal

sunnyratilal Nov 8, 2012

Contributor

Instead of using edit.php?post_type=slides&page=ctslider_all_options you should use admin_url( 'edit.php?post_type=slides&page=ctslider_all_options' );.

+ array_unshift($links, $settings_link);
+ }
+
+ return $links;
+}
+add_filter('plugin_action_links', 'ctslider_settings_link', 10, 2 );
View
@@ -0,0 +1,8 @@
+/* Hide Date Select Menu From Showing */
+#posts-filter .tablenav select[name=m] {
+ display: none;
+}
+
+#ctslider_post_thumb {
+ width: 15%;
+}
Oops, something went wrong.

0 comments on commit 62c5c28

Please sign in to comment.