CP Blocks
CP Blocks main features: Multiple blocks of code in the users’ websites Integration with the Calculated Fields Form plugin Integration with the Contact Form 7 plugin Allows the insertion of blocks in the website’s posts and pages Constant development including many new blocks … and more features CP Blocks is an easy way to insert cool buttons, styles, scripts, payment / donation buttons and features into your WordPress website without requiring programming knowledge. With CP Blocks you can access many resources like design elements, form’s fields, new features, and more. The use of CP Blocks is very simple, just press the “Insert Block” button in the controls of the “Contact Form 7” or the “Calculated Fields Form” plugin (Screenshots: 2. Contact Form 7 integration and 3. Calculated Fields Form integration), the “Insert Block” button is available beside the “Add Media” button too over the content of the pages/posts (Screenshot: 4. Integration with pages and posts) Some of the free blocks included are: Text Length: To calculate the number of characters in a text Print Form: For printing a form Lorem Ipsum Generator: Lorem ipsum text generator PayPal Donation Button: For inserting PayPal donation buttons Disable Text Selection Hightlighting: Disable the text selection hightlighting on the page Disable Right-click on the Page: Disable the mouse right-click menu Display current date: display the current date on the page Autorefresh page: Autorefresh the page every a specified number of seconds Tooltips: Allows associating tooltips to the form’s elements Grow Effect: Design effect Rounded Button: Button design Animated Border Button: Button design Corner Tab Button: Button design Border Effect Button: Button design Animated Border Button 2: Button design Button With Fold Effect: Button design Corner Tab Button 2: Button design Corner Tab Button 3: Button design Animated Border Button 3: Button design Slide Down Fill Button: Button design Slide Up Fill Button: Button design Slide Left Fill Button: Button design Dark Button With Icon: Button design Dark Button With Icon 2: Button design Beveled Dark Button: Button design Curtain Effect Button: Button design Button With Scaled Icon: Button design Image With Overlaying Testimonial: Information box design Testimonial Card with Icon, Quote and Title: Information box design Testimonial Card with Image, Title and Quote: Information box design Testimonial with Profile Image: Information box design Testimonial Card with Image, Title and Quote: Information box design Testimonial with Quote and Profile Image: Information box design Dark Themed Testimonial with Tile Quote and Profile Image: Information box design Some of the additional commercial blocks are: Words Counter: To calculate the number of words in a text Read CSV File: For reading an online CSV file and use it into form PayPal Payment Button: Inserts a PayPal one time payment button PayPal Subscription Button: Inserts a PayPal recurrent payment button Skrill Payment Button: Inserts a Skrill one time payment button Address Field: Inserts an autocomplete address field integrated to Google Places Prevent framing: Inserts a block to find out if the page is embedded as a frame to other site and will prevent that by redirecting to the correct page without framing Detect HTTP or HTTPS then force HTTPS: Inserts a code block to detect HTTP or HTTPS and then force usage of HTTPS to be sure that the page is loaded over a SSL secure connection. Ad Blocker Alert: Displays a pop-up window if there is an Ad Blocker active in the browser and limits the access to the page’s content in that case. How to insert the blocks? Press the “Insert Blocks” button in the toolbar of the forms builder in the “Calculated Fields Form” (Screenshot: 3. Calculated Fields Form integration), or the toolbar of the “Contact Form 7” (Screenshot: 2. Contact Form 7 integration). The button is available too beside the “Add Media” button in the posts and pages (Screenshot: 4. Integration with pages and posts) CP Blocks opens a popup window (Screenshot: 5. Blocks popup), that includes at top-right the list of blocks categories, and below it, the list of blocks. Selecting a specific category the blocks list is refreshed with their blocks. After selecting a block, its description, assets and insertion options are displayed in the right column (Screenshot: 6. Inserting the block) Pressing the “Insert Block” button the piece of code corresponding to the block is inserted in the website (Screenshot: 7. Block in the CFF form)
Top keywords
- button48×6.60%
- design26×3.58%
- blocks17×2.34%
- button design17×2.34%
- form16×2.20%
- block9×1.24%
- button button9×1.24%
- button button design9×1.24%
- page9×1.24%
- integration8×1.10%
- box7×0.96%
- box design7×0.96%
Gallery Image Captions (GIC)
With GIC, you can display the title, caption, and description image attributes. You can also change/filter the rendering HTML to whatever you want. After installing and activating GIC, write your filter and add the WordPress Gallery shortcode to your page. If you’ve been dreaming of writing a filter to customise the gallery image captions, then this plugin is for you. Visit the live demo page. Motivation The default WordPress gallery shortcode will only display the caption from the media’s attachment metadata. Sometimes it’s nice to display more like the title—even the description. The GIC plugin overrides the WordPress gallery shortcode function to create a hook. With this hook you can do a little bit more than just displaying the caption. Some premium themes hide the caption completely. This leaves photography lovers like me scratching their head and spending precious time cobbling together makeshift caption blocks. Usage Custom Filter For Displaying Captions The crux of this plugin is the ability to filter the gallery image caption. The galimgcaps_gallery_image_caption hook makes this possible. For the usage examples below, this is the filter used. /** * Custom Filter for Gallery Image Captions * * Note: Avoid altering captiontag, selector, and itemtag. */ function mlc_gallery_image_caption($attachment_id, $captiontag, $selector, $itemtag) { $id = $attachment_id; // Grab the meta from the GIC plugin. $my_image_meta = galimgcaps_get_image_meta($id); /** * Here's where to customise the caption content. * * This example uses the meta title, caption, and description. * * You can display any value from the $my_image_meta array. * You can add your own HTML too. */ return " " . "Title: " . $my_image_meta['title'] . " " . "Caption: " . $my_image_meta['caption'] . " ". "Description: ". $my_image_meta['description'] . " "; } add_filter('galimgcaps_gallery_image_caption', 'mlc_gallery_image_caption', 10, 4); Feel free to use this filter code as a starter template. After activating the GIC plugin, add the code above to your child theme’s functions.php file. Rename the function and tweak the return string to suit your needs. New Filter To Get Custom Fields /** * New GIC 1.4.0 filter for custom meta fields. */ function gic_add_custom_fields( $image_meta, $attachment ) { // This is how you add a custom fields to the array that // GIC uses to display captions. $image_meta['credit_text'] = $attachment->credit_text; $image_meta['credit_link'] = $attachment->credit_link; return $image_meta; } add_filter( 'galimgcaps_image_meta', 'gic_add_custom_fields', 10, 2 ); To use these two custom fields, your galimgcaps_gallery_image_caption would look something like this. function mlc_gallery_image_caption($attachment_id, $captiontag, $selector, $itemtag) { $id = $attachment_id; // Grab the meta from the GIC plugin. $my_image_meta = galimgcaps_get_image_meta($id); // If there's credit, give it where it's due complete with link. $credit = $my_image_meta['description'] ? " Credit : " . $my_image_meta['credit_text'] . " " . " " : ''; /** * With GIC 1.4.0 you can also add custom media attachment fields * to your captions. */ return " " . " Caption : " . $my_image_meta['caption'] . " " . $credit . " "; } add_filter('galimgcaps_gallery_image_caption', 'mlc_gallery_image_caption', 10, 4); Since v1.2.0, GIC automatically adds an Image ID column to your WordPress Media Library. This is to help you add the image IDs to your GIC shortcodes. See where GIC automatically adds an Image ID column to your WordPress Media Library. New in v1.4.0, GIC support custom media attachment fields. Usage Example 1 Shortcode For starters, let’s use a tag for the caption tag. [gallery size="full" columns="1" link="file" ids="114" captiontag="p"] Styling Let’s override the generated styles with our own style for one particular image. /* Targeting a Specific Image */ /* Add some padding all around. */ #gallery-1 .gallery-item, #gallery-1 .gallery-item p { padding: 1%; } /* Add some moody background with typewriter font. */ #gallery-1 .gallery-item { color: whitesmoke; background-color: black; font-size: 1.25rem; font-family: Courier, monospace; text-align: left !important; } Usage Example 2 Shortcode A 2 column x 1 row gallery with large size images using an H4 for the caption. [gallery size="large" columns="2" link="file" ids="109,106" captiontag="h4"] A 3 column x 1 row gallery with medium size images using a blockquote for the caption. [gallery size="medium" columns="3" link="file" ids="109,106,108" captiontag="blockquote"] Did you notice that we are using in the second shortcode? Let’s give it try just for kicks. Styling /* 1. Style the H4 Used in the Caption Example */ h4 { color: #777777 !important; font-size: 1.2rem !important; font-family: Helvetica, Arial, sans-serif !important; } /* 2. Help Align the Blockquote */ #gallery-3 .gallery-caption { margin-left: 40px !important; } Responsive CSS Example I recommend adding the following media queries if you use galleries with more than one image. The two media queries below will stack 2×1 and 3×1 galleries into a 1 column x n rows or 2 column x n rows as needed. /* Media Queries for Responsive Galleries */ /** * Styling based on article "How To: Style Your WordPress Gallery" * by Par Nicolas. * * https://theme.fm/how-to-style-your-wordpress-gallery/ */ /* Mobile Portrait Breakpoint - 1 column */ @media only screen and (max-width: 719.998px) { .gallery-columns-2 .gallery-item, .gallery-columns-3 .gallery-item { width: 100% !important; } } /* Mobile Landscape and Tablet Breakpoints - 2 columns */ @media only screen and (min-width: 720px) and (max-width: 1024px) { .gallery-columns-3 .gallery-item { width: 50% !important; } }