Giter VIP home page Giter VIP logo

ewels / cpt-bootstrap-carousel Goto Github PK

View Code? Open in Web Editor NEW
52.0 14.0 37.0 4.63 MB

WordPress plugin which generates a custom post type for choosing images and content. Outputs Bootstrap Image Carousel (slider) HTML from a shortcode.

Home Page: http://wordpress.org/plugins/cpt-bootstrap-carousel/

License: GNU General Public License v2.0

PHP 100.00%
bootstrap-carousel wordpress wordpress-plugin bootstrap carousel php

cpt-bootstrap-carousel's Introduction

Hi! I'm @ewels (Phil Ewels) πŸ‘‹

I'm a bioinformatician from the UK πŸ‡¬πŸ‡§ living in Sweden πŸ‡ΈπŸ‡ͺ

I've worked in a range of different positions, I'm currently product manager for open-source software at Seqera.

I created MultiQC, co-founded nf-core and am heavily involved with Nextflow. I also have a host of small side-projects, such as SRA-explorer, AWS-iGenomes and more general-use tools like rich-click and rich-codex.

I'm passionate about making software development best-practices available to scientists, unlocking high-throughput reproducible research to those working at the forefront of research.

You can find me on:

cpt-bootstrap-carousel's People

Contributors

aedelgod avatar atnon avatar benjaminleibinger avatar ewels avatar mapled avatar pfernandez avatar rchq avatar reddo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpt-bootstrap-carousel's Issues

Move the shortcode options into FAQ

  • Simplify the installation page a bit and move the shortcode options into the FAQ.
  • Add a separate shortcode example on a bullet point for each attribute. Mention that they can be joined together.
  • Clean up some of the text on the front page about attributes.

Commercial use

Hi !
I was wondering if I can use your plugin in a theme that I want to sell ?

Less shortcode options, more admin UI

Look into migrating some (all?) of the shortcode options into the administration user interface for easier use.

Potentially look to Contact Form 7 as an example of how to do this. Might be able to move some of the carousel options into the category pages? Don't want to force people to use categories though (shortcode options could override these).

Contextual help is on all pages

Accidental bug reported - contextual help is shown whilst editing all post types:

The contextual help is now shown on every type of post you edit in the backend. Therefore i suggest altering the cptbc_contextual_help_tab function to check for this condition before calling the $screen->add_help_tab function:

if( $screen->post_type === 'cptbc')

make width of image 100%

Hi everyone,
I am wondering how could I make the width of each image 100% as full screen
with cpt-bootstrap-carousel?

Many thanks

Make Bootstrap v3 Default

  • Add shortcode option to use glyphicon icons instead: .glyphicon .glyphicon-chevron-left and .glyphicon .glyphicon-chevron-right
  • Update documentation to describe differences in bootstrap versions and new shortcode options
  • Bump plugin version to v2.0 and give plenty of warnings about breaking backwards compatibility if necessary.

Carousel Templates

This is a big one. Can I rewrite the plugin to handle slides with multiple images? See this tweet for inspiration and this test for a hardcoded example.

Will need a rethink of how images are handled, as posts can only have one featured image.

image at 100% not cover all header if I resize like a small screen

Default like the uno.jpg.
Solved if I delete the img inside the item div and setting the $image_src a background of the item div (due.jpg)
< div class="item < ?php echo $key == 0 ? 'active' : ''; ? >" id="< ?php echo $image['post_id']; ? >" style="background: url('< ?php echo $image_src; ? >') no-repeat center center ;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;" >

there is a way to extend the plugin like this?
if full width 100% so use the $image_src like div item background and remove the image inside
else the normal funcionality..

default:
uno

background:
due

i18n

Make the plugin compatible with internationalisation. Docs

  • Wrap all text strings in _() (docs)
  • Make .POT files?
  • Ask people to write translations!

Shortcode option to specify single image

Feature request for a shortcode option id, to restrict the carousel to a single image.

Whilst displaying a single image is sort of against the whole point of a carousel, I can see that it could be useful to display images with captions easily.

Prep for WordPress 4.0

WordPress 4.0 is coming out soon, so it would be nice to get a release to tie in with the new features. Specifically:

  • Bump the "tested with" version number to 4.0 to avoid the nasty warnings
  • Create a square plugin logo for the new plugins grid view
    • Needs icon-128x128.png, icon-256x256.png and icon.svg
    • See JetPack for an example
  • Replace the current header image with Bootstrap 3 carousel & 2x banner-1544x500.png retina version

Carousel Items have noproper ID

Carousel Items have an id like 'id="578"'
ID identifiers are not allowed to start with a number therefore they don't work when you do something like the following in a style:
#578 .carousel-caption {...} /* does not work */

proposal:

In cptbc-frontend.php:109
Change:
id=""
to:
id="carousel-item-"

Update category code

Update line 43 of cptbc-frontend.php to use the updated category code:

$args['tax_query'][] = array(
    "taxonomy"  => "carousel_category",
    "field"     => "slug",
    "terms"     => $atts['category'],
    "operator"  => "IN"
);

See this forum post for discussion.

Make tutorial which can be shown when plugin is activated.

A recent plugin review said that the plugin isn't intuitive and it isn't particularly clear as to how you should set it up when first installed. They're not wrong. Could be good to have an on-install banner pop up with either a link to an instructions page or a screencast..

Add instructions for contributing

Quite a few people have been adding their own changes to the plugin lately, and telling me about them in a wide variety of ways. Encourage GitHub workflow with forking and pull requests. Write this up in the WordPress readme and also a CONTRIBUTING.md file on github (+ readme).

Don't clear the output buffer if there are no images

The output buffer is cleared with ob_end_clean(); even when there are no images. This shouldn't really matter - if this breaks the site when there are no images, it'll break it when there are images as well. However, there's no disadvantage to making it conditional on having some output, so it's cleaner to do so.

See this link for details.

Change class images???

Hi, thanks for the plugin

I need change the class of the images. Normaly i used this for add the bootstrap class image. look :
add_filter('post_thumbnail_html','add_class_to_thumbnail');
function add_class_to_thumbnail($thumb) {
if( is_single() ) $thumb = str_replace('attachment-', 'img img-responsive attachment-', $thumb);
return $thumb;
}
so, how can change in the plugin???

regards

Buttons for Slides / Responsive images with SVG

Hi there, thanks for the plugin. I've been hacking around on it and added a couple things that I think might add value.

  1. Buttons for slides: Added a little meta box to the admin panel for the user to specify whether they'd like to add a button like the Bootstrap 3.0 carousel demo: http://getbootstrap.com/examples/carousel/ . They can add text to the button and a link. Ideally there would be a search box there to link to existing content, but I don't have the time right now.
  2. Responsive Images: I'm using custom thumbnail sizes with add_image_size() for each of the default Bootstrap breakpoints, then using a function to output a simple SVG with the background-image property set to the appropriate thumbnail for the different sizes. So mobile users won't be receiving huge files, and the images won't look goofy on different screen sizes. Ideally there would also be an option in the editor to specify crops you'd like to use at each break point (auto crops don't always look the best), but I don't have the time for that right now.

It's a mess right now (hacked together), but if you're interested, let me know, and I'll clean it up and send a PR.

New options

Include new options in the settings to:

  • Disable the automatic animation on page load (click only)
  • Rely on data-attributes only, do not print the Javascript block

Image size option

Add an option in the settings / shortcode attribute for specifying the image size used in the carousel. This can then be customised using add_image_size(). This could give an advantage in loading times for small carousels for instance, as currently the raw original image is loaded and then resized using CSS.

Originally suggested by oheijo.

Limit of 10 images

The WP_Query is probably limiting to 10 posts by default for paging, rather than displaying all images.

Line 146, add 'posts_per_page' => '-1', to the WP_Query args.

Restrict featured images to post type

@grahamharper pointed out that the plugin enabled featured images for all post types. Would be better if this was specific to the CPT.

Change

add_filter('manage_posts_columns', 'cptbc_columns_head');
add_action('manage_posts_custom_column', 'cptbc_columns_content', 10, 2);

to

add_filter('manage_cptbc_posts_columns', 'cptbc_columns_head');
add_action('manage_cptbc_posts_custom_column', 'cptbc_columns_content', 10, 2);

http://wordpress.org/support/topic/featured-image-column-appearing-for-all-post-types?replies=1#post-4942524

Restructure the Settings page

The settings page isn't necessarily very intuitive - rewrite so that it has better structure and fuller explanations of what each option actually does.

write first-run tour

Write tour using Wordpress bubble pop up things to explain features on first run..

write drop down help

Write help in the drop down box in the top of admin pages. Especially shortcode attributes for reference.

Make compatible with Bootstrap v3

Twitter Bootstrap v3 RC1 has just been released. Thankfully the carousel has barely changed, so the plugin won't need to be updated too much (basically just the left and right indicators).

  • Replace &lsaquo; and &rsaquo; with <span class="icon-prev"></span> and <span class="icon-next"></span>
  • Add shortcode option to retain compatibility with bootstrap v2.x
    • Should twbs v2.x be the default with v3.x as a shortcode option?
    • This could be better until twbs v3.x is more widely adopted. Delays need for breaking backwards-compatibility of plugin too.

Bug with WP_DEBUG on

Bug reported by kjelelokk:
http://wordpress.org/support/topic/undefined-index-error-on-save-with-wp_debug-true?replies=2#post-5099006


When I try to save a image with WP_DEBUG set to true, I get this error:

Notice: Undefined index: cptbc_image_url_openblank in /home/1/p/petertflem/www/development/wordpress/wp-content/plugins/cpt-bootstrap-carousel/cpt-bootstrap-carousel.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /home/1/p/petertflem/www/development/wordpress/wp-content/plugins/cpt-bootstrap-carousel/cpt-bootstrap-carousel.php:124) in /home/1/p/petertflem/www/development/wordpress/wp-admin/post.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home/1/p/petertflem/www/development/wordpress/wp-content/plugins/cpt-bootstrap-carousel/cpt-bootstrap-carousel.php:124) in /home/1/p/petertflem/www/development/wordpress/wp-includes/pluggable.php on line 896

It works fine if I set WP_DEBUG = false, but it should work with it set to true, or at least that is what I am thinking.

Enable categories

Set up categories for carousel posts. Add in an extra shortcode option which specifies which category to take images from (default - all images, as currently).

This allows multiple carousels to be used on a single site, each with different images and different behaviour.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.