2017 © Pedro Peláez
 

wordpress-plugin acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

image

mwdelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  • Wednesday, June 6, 2018
  • by MWDelaney
  • Repository
  • 2 Watchers
  • 45 Stars
  • 1,276 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

Advanced Custom Fields Complex Titles

A WordPress plugin that adds custom fields to create a formatted title, (*1)

This plugin creates custom fields below the title Pages and automatically replaces the_title() when called from inside the loop., (*2)

Screenshot, (*3)

Requirements

  1. WordPress 4.5+
  2. Advanced Custom Fields Pro 5

Usage

The following formatting options are included at this time:, (*4)

  1. Word or Phrase (the actual content, don't remove this one)
  2. Emphasize
  3. Size (small, medium, large)
  4. Alignment (left, right, center)

The following layouts are also included for headline groups:, (*5)

  1. Alignment

Add fields

To add fields to the title(s), extend the Fields class as follows:, (*6)

     // Replace the plugin's Fields class with our class extending it
     add_filter ('acfct_set_fields_class',  function() { return 'myFields'; });

     // Add custom CSS to style the new fields
     add_action ('complex_titles_css', 'addMyStyles');

     /**
      * Add styling for the new fields
      *     Naming scheme is as follows:
      *         .complex-title-element-[your-field-acf-name]
      */

     function addMyStyles() {
         // Variable containing the styles we want to add
         $myStyles = "
            .complex-title-element-underline {
                text-decoration: underline;
            }
         ";

         // Enqueue these styles along with the plugin's other styles
         wp_add_inline_style( 'acf-complex-titles-style', $myStyles );
     }

     // Our class extending the plugin's class to add new fields
     class myFields extends MWD\ComplexTitles\Fields {
         /**
         * Field: Underline
         *
         * @author Michael W. Delaney
         * @since 1.0
         *
         * Checkbox
         */
        public $underline = array (
            'order' => '10',
            'field' => array (
                'key' => 'acfct_underline',
                'label' => 'Underline',
                'name' => 'underline',
                'type' => 'true_false',
            )
        );
     }

Enable only some fields

To remove fields from the available list, declare theme support for only the fields you wish to use:, (*7)

add_theme_support( 'complex-titles-fields', array( 'word-or-phrase', 'size' ) );

Enable only some layouts

To remove layouts from the available list, declare theme support for only the layouts you wish to use:, (*8)

add_theme_support( 'complex-titles-layout', array( 'alignment' ) );

Change which post types get Complex Titles

By default complex titles are enabled for Pages, to define which post types complex titles should be available on, declare theme support:, (*9)

 $landing_page_templates = array(
   array (
     array (
       'param' => 'post_type',
       'operator' => '==',
       'value' => 'page',
     ),
     array (
       'param' => 'page_template',
       'operator' => '!=',
       'value' => 'template-no-header-image.php',
     ),
   ),
 );
 add_theme_support( 'complex-titles-location', $landing_page_templates );

Templates

Basic templates and styles are included. These templates are designed to be simple for styling via your theme. To override the included templates, copy the template(s) you wish to override from templates to your theme in a sub-directory called ct-templates, (*10)

Styles

This plugin ships with basic styling for the default fields. These styles are enqueued on the front-end and in the WordPress admin so that the Complex Title preview area matches the front-end as closely as possible. To dequeue these styles and replace them with your own, add the following to functions.php, (*11)

remove_action('complex_titles_css', array( $acf_complex_titles, 'front_end_styles' ) );

The Versions

06/06 2018

dev-master

9999999-dev https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

21/12 2017

1.15

1.15.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

18/10 2017

1.14

1.14.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

20/09 2017

1.13

1.13.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

05/04 2017

1.12

1.12.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

05/04 2017

1.2

1.2.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

01/01 2017

1.11

1.11.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

01/01 2017

1.1

1.1.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields

31/12 2016

1.0

1.0.0.0 https://github.com/MWDelaney/acf-complex-titles

Complex titles with previews for WordPress content types using Advanced Custom Fields Pro 5.

  Sources   Download

MIT

The Requires

 

plugin wordpress title advanced custom fields