Giter Site home page Giter Site logo

evanherman / timeline-express Goto Github PK

View Code? Open in Web Editor NEW
21.0 8.0 13.0 8.3 MB

Timeline express allows you to create a vertical animated and responsive timeline of posts, without writing a single line of code. Sweet!

Home Page: https://www.wp-timelineexpress.com

CSS 24.40% JavaScript 9.13% PHP 65.46% Shell 1.01%
wordpress wordpress-plugin timeline-express timeline-plugin php vertical animated font-awesome

timeline-express's Introduction

Timeline Express - 1.8.1

Built with Grunt Build Status Code Climate Test Coverage Issue Count Project Stats

Timeline Express

Tags: timeline, responsive, time, line, vertical, animated, company, history, font awesome, events, calendar, scroll, dates, story, timeline express, milestone, stories
Requires at least: WordPress v4.2
Tested up to: WordPress v5.0
Stable tag: 1.8.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

WordPress plugin WordPress WordPress WordPress rating

Description

Timeline Express is a WordPress plugin that creates a vertical animated, responsive timeline of posts, in chronological order.

Timeline Express has been maintained for 3+ years, and remains the #1 WordPress Timeline Plugin on WordPress.org. While there have been a few copy cat plugins popping up recently, Timeline Express remains the most feature packed, top supported and top rated plugin timeline plugin for WordPress sites.

Timeline Express has grown to be more than just a simple timeline plugin, and can be extended for different use cases. For example, our Timeline Express Twitter Feeds Add-On converts a specified timeline into a twitter feed for a given user or search term.

New Site & Documentation

For the new version of Timeline Express, we built out an entirely new site to showcase the features & add-ons of Timeline Express.

Additionally, the documentation for the new version of timeline express can be found at WP Timeline Express.

Internationalization

All of the strings contained in Timeline Express are properly prepared for translation, closely following the WordPress coding standards. That means you can create a Timeline in multiple languages, to be used on a multi-language site.

If you are multi-lingual, and want to help out with translations, feel free to work with glotpress.org to help provide additional translations!

Additionally, Timeline Express comes with full WPML Support and is the only timeline plugin supported by WPML.

Other WordPress translation plugins will work just as well, including Polylang and qtranslate.

FAQ and Documentation

Custom Announcement Template

Copy over templates/timeline-express-container.php into your theme root, in a timeline-express directory (wp-content/themes/theme_name/timeline-express/timeline-express-container.php), and start customizing.

Custom Single Announcement Template

Copy over templates/single-timeline-express.php into your theme root, in a timeline-express directory (wp-content/themes/theme_name/timeline-express/single-timeline-express.php), and start customizing.

Or to quickly and easily get the timeline announcements to look the same as your current theme, you can duplicate your existing 'single.php' template file, place it in a 'timeline-express' directory in your theme root, and replace get_template_part(); or the_content(); with the following Timeline Express helper function timeline_express_content();. Once added you can save the file, and you're all set.

Years Instead of Icons

Many users have asked for the ability to display the year instead of displaying the Font Awesome icons. With version 1.2, we've built in support to allow users to quickly swap out the icons for the year by dropping a single line of code into the functions.php file of the active theme.

define( 'TIMELINE_EXPRESS_YEAR_ICONS', true );

Once added to your active themes functions.php file, you'll notice that the icon drop down no longer displays on your announcement posts - and on the front end of your site the icons are replaced with the year selected for the given announcement. If you need to style the year, or make any other sort of tweaks, you can target the element by using the following class .

Custom Container Classes

Another extremely popular request was the ability to assign custom classes to the announcement containers, for further styling. In version 1.2 we've built in a filter to allow users to add additional classes as needed - timeline-express-announcement-container-class.

Additionally, similar to the method mentioned above, users can drop a single line of code into their functions.php file, and be off to the races.

define( 'TIMELINE_EXPRESS_CONTAINER_CLASSES', true );

Once added, you'll find a new metabox added to your announcement new/edit page titled 'Custom Container Class'. From here, you can enter the custom classes into the metabox, and save or update your post for the changes to take effect. You should now find that the newly defined classes are appended to the respective announcement containers.

Actions & Filters

Timeline Express is constructed with extensibility in mind. That means there are a number of actions and filters that developers can make use of, to extend the base functionality of Timeline Express.

For a visual map of the locations of the hooks within the plugin, please see this article.

Adding Custom Metaboxes and Fields

Users have the ability to add additional meta boxes and fields as needed to the announcement post types. This can be achieved by utilizing the action hook timeline_express_metaboxes, or filtering the available metaboxes within the timeline_express_custom_fields filter. Using the timeline_express_custom_fields filter will allow you to add additional fields to the default 'Announcement Info.' metabox.

If you need to add custom metaboxes, it is recommended that you hook into timeline_express_metaboxes and define your metaboxes.

Example

/**
 * Timeline Express Add Custom Metabox
 * @param  array $options Array of options for Timeline Express.
 */
function define_new_metabox( $options ) {
	$announcement_custom_metabox = new_cmb2_box( array(
		'id'            => 'announcement_custom_metabox',
		'title'         => __( 'Announcement Custom Metabox', 'text-domain' ),
		'object_types'  => array( 'te_announcements' ), // Post type
		'context'       => 'advanced',
		'priority'      => 'high',
		'show_names'    => true, // Show field names on the left
	) );
	// Container class
	$announcement_custom_metabox->add_field( array(
		'name' => __( 'Custom Field', 'text-domain' ),
		'desc' => __( 'Custom description.', 'text-domain' ),
		'id'   => 'announcement_custom_field',
		'type' => 'text',
	) );
}
add_action( 'timeline_express_metaboxes', 'define_new_metabox' );

Users can then display the new meta anywhere on their site or in page templates using the built in function timeline_express_get_custom_meta( $post->ID, 'announcement_custom_field', true ).

Below you'll find a complete list of Actions and Filters contained within the Timeline Express code base.

Filters

timeline_express_slug or timeline-express-slug (legacy)

  • Description: Alter the default slug for all Timeline Express announcement posts. The slug is the text that appears in the URL eg: http://www.example.com/announcement/announcement-name, where 'announcement' is the slug.
  • Location: /timeline-express/lib/admin/cpt/cpt.announcements.php
  • Paramaters: $slug
  • Default: 'announcement'

Example Usage

/**
 * Alter the default Timeline Express slug
 * Change 'announcement' to 'event'
 */
function alter_timeline_express_slug( $slug ) {
	$slug = 'event';
	return $slug;
}
add_filter( 'timeline_express_slug', 'alter_timeline_express_slug' );

timeline_express_singular_name

  • Description: This alters the 'singular_name' inside of register_post_type(). Alter the text in the dashboard for all instances of 'Announcement'. This filter will alter most instances of the text 'Announcement' in the admin menus, edit table etc. For all other instances of 'Announcement', you should use the gettext filter.
  • Location: /timeline-express/lib/admin/cpt/cpt.announcements.php
  • Paramaters: $single_name
  • Default: 'Announcement'

Example Usage

/**
 * Alter most instances of 'Announcement' in the dashboard.
 * Change 'Announcement' to 'Event'
 */
function alter_timeline_express_single_name( $single_name ) {
	$single_name = 'Event';
	return $single_name;
}
add_filter( 'timeline_express_singular_name', 'alter_timeline_express_single_name' );

timeline_express_plural_name

  • Description: This alters the 'singular_name' inside of register_post_type(). Alter the text in the dashboard for all instances of 'Announcements'. This filter will alter most instances of the text 'Announcements' in the admin menus, edit table etc. For all other instances of 'Announcements', you should use the gettext filter.
  • Location: /timeline-express/lib/admin/cpt/cpt.announcements.php
  • Paramaters: $plural_name
  • Default: 'Announcements'

Example Usage

/**
 * Alter most instances of 'Announcements' in the dashboard.
 * Change 'Announcements' to 'Events'
 */
function alter_timeline_express_plural_name( $plural_name ) {
	$plural_name = 'Events';
	return $plural_name;
}
add_filter( 'timeline_express_plural_name', 'alter_timeline_express_plural_name' );

timeline_express_admin_column_date_format

  • Description: Use this filter to alter the date format inside of the admin table, listed in the 'Announcement Date' column.
  • Location: /timeline-express/lib/admin/cpt/timeline-express-admin-columns.php
  • Paramaters: $date_format
  • Default: get_option( 'date_format' ) - WordPress date format set inside of your site settings.

Example Usage

/**
 * Alter the date format in the admin column 'Announcement Date'.
 * Set the date format to 'January 1st, 2016' eg: `F jS, Y`
 */
function alter_timeline_express_admin_column_date_format( $date_format ) {
	$date_format = 'F jS, Y';
	return $date_format;
}
add_filter( 'timeline_express_admin_column_date_format', 'alter_timeline_express_admin_column_date_format' );

timeline_express_custom_fields

  • Description: Add additional fields to the Timeline Express announcements. This will add fields admin side, but you will need to display them in your templates using our helper function timeline_express_get_custom_meta() or the built in WordPress function get_post_meta().
  • Location: /timeline-express/lib/admin/metaboxes/metabox.announcements.php
  • Paramaters: $fields
  • Default: Array of default Timeline Express fields.

Example Usage

/**
 * @todo
 * Define additional custom fields to display on the Timeline Express announcements.
 */
function add_custom_timeline_express_fields( $fields ) {
	$fields[] = array();
	return $fields;
}
add_filter( 'timeline_express_custom_fields', 'add_custom_timeline_express_fields' );

timeline_express_font_awesome_version

  • Description: Specify which version of Font Awesome you want to use to display your icons. Defaults to 4.6.1 (or latest).
  • Location: /timeline-express/lib/admin/metaboxes/partials/bootstrap-icon-dropdown.php
  • Paramaters: $font_awesome_version
  • Default: Array of default Timeline Express fields.

Example Usage

/**
 * Specify Font Awesome version 4.4.0
 */
function alter_timeline_express_font_awesome_version( $font_awesome_version ) {
	$font_awesome_version = '4.4.0';
	return $font_awesome_version;
}
add_filter( 'alter_timeline_express_font_awesome_version', 'timeline_express_font_awesome_version' );

timeline_express_admin_render_date_format

  • Description: Alter how the date is rendered in the Announcement Date field on the edit announcement page. This field is used in our 'Historical Dates' add on. This should default to the same format as the global WordPress date format setting. Note: You should not use this filter when you have the 'Historical Dates' add on installed and active.
  • Location: /timeline-express/lib/admin/metaboxes/partials/time-stamp-custom.php
  • Paramaters: $date_format
  • Default: get_option( 'date_format' )

Example Usage

/**
 * Alter the way the date is rendered on the edit announcements page
 */
function alter_timeline_express_admin_date_format( $date_format ) {
	$font_awesome_version = '4.4.0';
	return $date_format;
}
add_filter( 'timeline_express_admin_render_date_format', 'alter_timeline_express_admin_date_format' );

timeline_express_announcement_query_args

  • Description: Alter the query arguments for the Timeline query. This will alter how the Timeline is rendered on the frontend. For help see WP_Query.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_args, $post, $atts
  • Default: Array of query arguments. Variable, depending on the Timeline Express settings.

Example Usage

/**
 * Limit the Timeline to 5 announcements.
 */
function alter_timeline_express_front_end_query( $announcement_args, $post, $atts ) {
	$announcement_args['posts_per_page'] = 5;
	return $announcement_args;
}
add_filter( 'timeline_express_announcement_query_args', 'alter_timeline_express_front_end_query', 10, 3 );

timeline_express_icon

  • Description: Alter the icon for ALL announcements globally, or for each individual announcement (using the $post_id variable).
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_icon, $post_id
  • Default: The icon set when you created the announcement, under the 'Announcement Icon' setting.

Example Usage

/**
 * Set all icons to 'fa-reddit' (globally)
 */
function alter_timeline_express_icon( $announcement_icon, $post_id ) {
	$announcement_icon = 'fa-reddit';
	return $announcement_icon;
}
add_filter( 'timeline_express_icon', 'alter_timeline_express_icon', 10, 2 );

timeline_express_icon_color

  • Description: Alter the color for ALL announcements globally, or for each individual announcement (using the $post_id variable). Note: You should use a hex value.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_icon_color, $post_id
  • Default: The color set when you created the announcement, under the 'Announcement Color' setting.

Example Usage

/**
 * Set all icons to #0000FF (blue) (globally)
 */
function alter_timeline_express_icon_color( $announcement_icon_color, $post_id ) {
	$announcement_icon_color = '#0000FF';
	return $announcement_icon_color;
}
add_filter( 'timeline_express_icon_color', 'alter_timeline_express_icon_color', 10, 2 );

timeline_express_date

  • Description: Alter the date for ALL announcements globally, or for each individual announcement (using the $post_id variable). To alter the date format, see the timeline_express_date_format filter.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $date_text, $post_id
  • Default: The text of the returned and formatted announcement date.

Example Usage

/**
 * Alter the returned date text (globally)
 * Set it to 'Announcement Date : Date'
 */
function alter_timeline_express_date_text( $date_text, $post_id ) {
	$date_text = 'Announcement Date : ' . $date_text;
	return $date_text;
}
add_filter( 'timeline_express_date', 'alter_timeline_express_date_text', 10, 2 );

timeline_express_image

  • Description: Alter the image for ALL announcements globally, or for each individual announcement (using the $post_id variable). To alter the image size see the timeline_express_announcement_img_size filter.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $image_html, $post_id
  • Default: The color set when you created the announcement, under the 'Announcement Color' setting.

Example Usage

/**
 * Remove the announcement images (globally)
 */
function alter_timeline_express_image_html( $image_html, $post_id ) {
	$image_html = '';
	return $image_html;
}
add_filter( 'timeline_express_image', 'alter_timeline_express_image_html', 10, 2 );

timeline_express_announcement_img_size or timeline-express-announcement-img-size (legacy)

  • Description: Alter the image size for ALL announcements globally, or for each individual announcement (using the $post_id variable). You can use any defined image size, or define your own image sizes using add_image_size().
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $image_html, $post_id
  • Default: 'timeline-express' - 350x x 120px Hard Cropped - Image size defined by the plugin itself.

Example Usage

/**
 * First define a custom image size, then and set our announcements to use the new image size.
 */

 // Register a new custom image size 'custom-size' - 750px x 300px Hard Cropped
 add_image_size( 'custom-size', '500', '300', true );

// Use our new image size on the announcements
function set_custom_timeline_express_image_size( $image_size, $post_id ) {
	$image_size = 'custom-size';
	return $image_size;
}
add_filter( 'timeline_express_announcement_img_size', 'set_custom_timeline_express_image_size', 10, 2 );

timeline_express_read_more_link

  • Description: Alter the Timeline Express read more link markup, or set custom markup using the $post_id variable to set the href. Note: To alter the read more classes see, timeline_express_read_more_class. To alter the read more text, see timeline_express_read_more_text.
  • Location: /timeline-express/lib/helpers.php
  • Paramaters: $read_more_html, $post_id
  • Default: HTML markup for the read more link

Example Usage

/**
 * Wrap the read more html in <p> tags and remove the elipses (...)
 */
function custom_timeline_express_read_more_link( $read_more_html, $post_id ) {
	$read_more_html = '<p>' . str_replace( '...', '', $read_more_html ) . '</p>';
	return $read_more_html;
}
add_filter( 'timeline_express_read_more_link', 'custom_timeline_express_read_more_link', 10, 2 );

timeline_express_read_more_class

  • Description: Alter the Timeline Express read more link class, or add additional classes.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $read_more_classes, $post_id
  • Default: 'timeline-express-read-more-link'

Example Usage

/**
 * Add an additional class to the Timeline read more link.
 */
function add_additional_read_more_link_classes( $read_more_classes, $post_id ) {
	$read_more_classes = $read_more_classes . ' custom-read-more-class';
	return $read_more_classes;
}
add_filter( 'timeline_express_read_more_class', 'add_additional_read_more_link_classes', 10, 2 );

timeline_express_read_more_text

  • Description: Alter the Timeline Express read more link text.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $read_more_text, $post_id
  • Default: 'timeline-express-read-more-text'

Example Usage

/**
 * Set the read more link text from 'read more' to 'View this Announcement'
 */
function alter_timeline_express_read_more_text( $read_more_text, $post_id ) {
	$read_more_text = 'View this Announcement';
	return $read_more_text;
}
add_filter( 'timeline_express_read_more_text', 'alter_timeline_express_read_more_text', 10, 2 );

timeline_express_read_more_text

  • Description: Alter the Timeline Express read more link text.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $read_more_text, $post_id
  • Default: 'timeline-express-read-more-text'

Example Usage

/**
 * Set the read more link text from 'read more' to 'View this Announcement'
 */
function alter_timeline_express_read_more_text( $read_more_text, $post_id ) {
	$read_more_text = 'View this Announcement';
	return $read_more_text;
}
add_filter( 'timeline_express_read_more_text', 'alter_timeline_express_read_more_text', 10, 2 );

timeline_express_frontend_excerpt

  • Description: Alter the Timeline Express excerpt text.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_excerpt, $post_id
  • Default: The excerpt pulled from the current announcement.

Example Usage

/**
 * Set the timeline excerpt to something custom
 */
function alter_timeline_express_custom_excerpt_text( $announcement_excerpt, $post_id ) {
	$announcement_excerpt = 'Custom Announcement Excerpt';
	return $announcement_excerpt;
}
add_filter( 'timeline_express_frontend_excerpt', 'alter_timeline_express_custom_excerpt_text', 10, 2 );

timeline_express_random_excerpt

  • Description: Alter the Timeline Express excerpt, when your announcements are set to random length.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_random_excerpt, $post_id
  • Default: An excerpt of random length, pulled from the current announcement.

Example Usage

/**
 * Set the timeline random excerpt to something custom
 */
function alter_timeline_express_custom_random_excerpt_text( $announcement_random_excerpt, $post_id ) {
	$announcement_random_excerpt = 'Custom Announcement Random Excerpt';
	return $announcement_random_excerpt;
}
add_filter( 'timeline_express_random_excerpt', 'alter_timeline_express_custom_random_excerpt_text', 10, 2 );

timeline_express_random_excerpt_min

  • Description: Alter the minimum value of the randomly generated text. The excerpt will be generated from a random number between 50 and 200.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_random_excerpt_min, $post_id
  • Default: 50

Example Usage

/**
 * Set the minimum excerpt length to 20, when randomly generating the excerpt.
 */
function alter_timeline_express_random_excerpt_min( $announcement_random_excerpt_min, $post_id ) {
	$announcement_random_excerpt_min = 20;
	return $announcement_random_excerpt_min;
}
add_filter( 'timeline_express_random_excerpt_min', 'alter_timeline_express_random_excerpt_min', 10, 2 );

timeline_express_random_excerpt_max

  • Description: Alter the maximum value of the randomly generated text. The excerpt will be generated from a random number between 50 and 200.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $announcement_random_excerpt_max, $post_id
  • Default: 200

Example Usage

/**
 * Set the maximum excerpt length to 400, when randomly generating the excerpt.
 */
function alter_timeline_express_random_excerpt_max( $announcement_random_excerpt_min, $post_id ) {
	$announcement_random_excerpt_max = 400;
	return $announcement_random_excerpt_max;
}
add_filter( 'timeline_express_random_excerpt_max', 'alter_timeline_express_random_excerpt_max', 10, 2 );

timeline_express_compare_sign

  • Description: Alter the compare sign of the WP_Query object, for the timeline.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $compare_sign, $post_id
  • Default: Variable, based on the setting assigned to the 'Announcement Time Frame' setting. Possible: '>', '', '<='

Example Usage

/**
 * Adjust the compare sign of the WP_Query
 * Set to 'All Annoumcenets(Past+Future)' '<='
 */
function alter_timeline_express_query_compare_sign( $compare_sign, $post_id ) {
	$compare_sign = '<=';
	return $compare_sign;
}
add_filter( 'timeline_express_compare_sign', 'alter_timeline_express_query_compare_sign', 10, 2 );

timeline_express_html_comment

  • Description: Alter the Timeline Express HTML comment generated below Timeline Express.
  • Location: /timeline-express/lib/classes/class-timeline-express-intialize.php
  • Paramaters: $timeline_express_comment
  • Default: Current installed Timeline Express version with author attribution.

Example Usage

/**
 * Remove the HTML comment generated by Timeline Express
 */
function remove_timeline_express_html_comment( $timeline_express_comment ) {
	$timeline_express_comment = '';
	return $timeline_express_comment;
}
add_filter( 'timeline_express_html_comment', 'remove_timeline_express_html_comment' );

timeline_express_menu_cap

  • Description: Alter who can access the Timeline Express admin menu, by capability.
  • Location: /timeline-express/lib/classes/class-timeline-express.php
  • Paramaters: $menu_cap
  • Default: 'manage_options' - Site admins only

Example Usage

/**
 * Allow 'Editors', or users with the 'edit_posts' capability, access to Timeline Express.
 */
function alter_timeline_express_admin_menu_cap( $menu_cap ) {
	$menu_cap = 'edit_posts';
	return $menu_cap;
}
add_filter( 'timeline_express_menu_cap', 'alter_timeline_express_admin_menu_cap' );

timeline_express_tinymce_post_types

  • Description: Alter which post types the Timeline Express tinyMCE button appears on.
  • Location: /timeline-express/lib/classes/class-timeline-express.php
  • Paramaters: $post_types_array
  • Default: array( 'page', 'post' )

Example Usage

/**
 * Enable the Timeline Express tinyMCE button on the 'testimonials' post type.
 */
function alter_timeline_express_tinymce_post_types( $post_types_array ) {
	$post_types_array[] = 'testimonials';
	return $post_types_array;
}
add_filter( 'timeline_express_tinymce_post_types', 'alter_timeline_express_tinymce_post_types' );

timeline_express_single_content

  • Description: Adjust the content on the single announcement template page.
  • Location: /timeline-express/lib/classes/class-timeline-express.php
  • Paramaters: $single_content, $post_id
  • Default: Current announcement content.

Example Usage

/**
 * Append custom content onto the end of the content on the single announcement template.
 */
function alter_timeline_express_single_template_content( $single_content, $post_id ) {
	$single_content = $single_content . ' | Custom content appended.';
	return $single_content;
}
add_filter( 'timeline_express_single_content', 'alter_timeline_express_single_template_content', 10, 2 );

timeline_express_single_page_template or timeline-express-single-page-template (legacy)

  • Description: Set which template is used to display the single announcements. By default the plugin will look for a file called single-announcement-template.php located inside of a /timeline-express/ directory in your theme root. If that is not found, it will look for a single.php template in the theme root. Finally if neither are found, it will use page.php.
  • Location: /timeline-express/lib/classes/class-timeline-express.php
  • Paramaters: $single_template
  • Default: Default template chosen to be used for single announcements. Possible: single.php, page.php, /path/to/custom-template.php

Example Usage

/**
 * Load a custom template called 'single-announcement-template.php' located in the theme root directory.
 */
function set_timeline_express_single_template( $single_template ) {
	$single_template = get_stylesheet_directory() . 'single-announcement-template.php';
}
add_filter( 'timeline_express_single_page_template', 'set_timeline_express_single_template' );

timeline_express_custom_icon_html or timeline-express-custom-icon-html (legacy)

  • Description: Use a custom icon in place of the default loaded one.
  • Location: /timeline-express/lib/public/partials/timeline-express-container.php
  • Paramaters: $custom_icon_markup, $post_id or $post ($post_id for new filter, $post (global post ojbect) for legacy filter)
  • Default: '' (empty). Note: Once markup is found, this will override the default icons.

Example Usage

/**
 * @todo
 * Use a custom icon instead of the standard Font Awesome icons
 */
function set_custom_icon_html_markup( $post_id ) {
	/**
	 * To do..
	 */
}
add_filter( 'timeline_express_custom_icon_html', 'set_custom_icon_html_markup' );

timeline-express-announcement-container-class

  • Description: Add additional classes to each announcement container on the time line.
  • Location: /timeline-express/lib/public/partials/timeline-express-container.php
  • Paramaters: $class & $announcement_id
  • Default: 'cd-timeline-block'.

Example Usage

/**
 * The following example will append 'custom-class' on to each announcement
 * container on the timeline.
 * @param string   $class             The default classes to filter.
 * @param integer  $announcement_id   The announcement ID to retrieve data from.
 */
public function add_additional_timeline_container_classes( $class, $announcement_id ) {
	$container_classes = array( $class );
	$container_classes[] = 'custom-class';
	return implode( ' ', $container_classes );
}
add_filter( 'timeline-express-announcement-container-class', 'add_additional_timeline_container_classes', 10, 2 );

Actions

timeline_express_metaboxes

  • Description: Define additional metaboxes on the announcement post new/edit screen.
  • Location: /timeline-express/lib/admin/cpt/cpt.announcements.php
  • Paramaters: $options - The array of Timeline Express options retreived from the databse.

Example

/**
 * Timeline Express Add Custom Metabox
 * @param  array $options Array of options for Timeline Express.
 */
function define_new_timeline_express_metabox( $options ) {
	$announcement_custom_metabox = new_cmb2_box( array(
		'id'            => 'announcement_custom_metabox',
		'title'         => __( 'Announcement Custom Metabox', 'text-domain' ),
		'object_types'  => array( 'te_announcements' ), // Post type
		'context'       => 'advanced',
		'priority'      => 'high',
		'show_names'    => true, // Show field names on the left
	) );
	// Container class
	$announcement_custom_metabox->add_field( array(
		'name' => __( 'Custom Field', 'text-domain' ),
		'desc' => __( 'Custom description.', 'text-domain' ),
		'id'   => 'announcement_custom_field',
		'type' => 'text',
	) );
}
add_action( 'timeline_express_metaboxes', 'define_new_timeline_express_metabox' );

To use the newly assigned meta, you can use the helper function timeline_express_get_custom_meta( $post_id, $meta_id );. In the following example, we'll use the 'announcement_custom_field' that we created in the previous step, hook into timeline-express-container-top, and display our meta above the announcement title on the Timeline.
Keep in mind there are a number of action hooks readily available in the plugin for you to make use of. For a visual representation of the hooks available in Timeline Express, and there locations, please see this article.

/**
 * Display the new custom meta, at the top of our announcement container
 * @return string The contents of the new meta field.
 */
function sample_use_custom_meta() {
	global $post;
	echo wp_kses_post( '<strong>' . timeline_express_get_custom_meta( $post->ID, 'announcement_custom_field', true ) . '</strong>' );
}
add_action( 'timeline-express-container-top', 'sample_use_custom_meta' );

timeline-express's People

Contributors

evanherman avatar petenelson avatar

Stargazers

 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

timeline-express's Issues

Announcement Image URL

Hello,

this may be an easy question but please bear.

I am trying to add url to the Announcement Image. to direct to another page.

But i was not successful. please help.

Thank you for this plugin.

Version broken

Hi Evan,

I have tried to install version(Timeline Express - v1.2) on my wordpress site, but it seems that version is not complete yet.
For example:
The icons are missing
1

2
When adding a new image for the announcement "Announcement Image", the button doesn't work.
I have tried to install it on my local machine and also on my remote server, but I got the same result.

Thanks for this awesome plugin,

Peshmerge

Incorrect dates inside timeline circles

When using the free version with the historic dates add-on and the 'Years Instead of Icons' option enabled, the years are displaying incorrect on the timeline in the circle.

Example:
Example

Features to add


Completed:

  • Setting to select icon color (on announcement creation + default icon color in settings ) [v1.1.5]
  • Transients to cache front-end queries. Should clear whenever an announcement is saved (save_post hook). [v1.2]
  • Remove AJAX save settings. Causing issue for some people who are leaving negative reviews without requesting support. [v1.2]
  • Setting to toggle animation effects [v1.2]
  • Limit number of posts displayed, with a 'load more' button to lazy load some more
  • Setting to define a slug for the announcement posts [feature added in v1.1.5]
  • Premium version with multiple timelines etc.
  • Fix theme overriding Timeline Express excerpt length by adding priority and conditional. [v1.2.2]
  • Remove 'Read More' links from the excerpts, leave as ellipses (...). [v1.2.2]
  • Add 'Read More' link to timeline-express-after-excerpt hook, so the read more link is always present, regardless of excerpt length. [v1.2.2]
  • Updates to the random excerpt length. [v1.2.2]
  • Fix admin table responsive styles, causing weird stacking [v1.2.2]
  • Look into date picker localization/calendar translations etc. [v1.2.2] - Option now controlled via General > Date Format
  • Responsive images (not 100% width) on single announcements. (srcset attr) [v1.2.7]Note: No more 100% width images on the single announcement template, if you need them to be 100% you can use the following CSS:
body.single-te_announcements .announcement-banner-image { width: 100% }

This will only target images on single announcement page templates, not on the timeline
Should still look into srcset attr

  • Re-check the excerpt length not working properly. (themes are most likely overriding the option, with the excerpt_length filter. Probably at a higher priority.)
  • Take another look at the responsiveness of the timeline on mobile devices (seems to be overflowing outside the browser window).[v1.2.7] timeline now adjusts to 95% width at 822px and below
  • Set announcement containers to 100% when < 822px. [v1.2.7]
  • Set width auto on the single announcement images. [v1.2.7]
  • Build in support for additional international dates (https://wordpress.org/support/topic/french-date-format-issue?replies=12#post-8423928) [v.1.2.7] built in support for j F Y date formats, as per the request in the above forum
  • Add missing image class to the announcement image on announcement single page (https://wordpress.org/support/topic/minor-css-class-request?replies=2) .announcement-banner-image [v1.2.7.1]
  • Look into weird ajax breaking issue (https://wordpress.org/support/topic/problem-with-wordpress-media-library-grid-view-and-all-ajax-requests?replies=1) [v1.2.8]
  • Tweak public param in cpt register array so that the items appear in searches properly based on the setting. [v1.2.8 free & v1.2.6 pro]
  • Timelines limited to a single timeline, attempting to display filters are not working properly. Only works when multiple timelines & categories are being used. [v1.2.6.2 pro]

Announcement ordering in the dashboard

Clicking on the 'Announcement Date' column header should sort the announcements in Ascending/Descending order depending on the setting, but currently does not order them properly.

Look into our post column sorting function, and patch it up for the next release

Custom Date Feature Breaks Ordering

Sort feature with a custom filter not working properly. Some dates just don't appear.

Once this issue is resolve, we will roll out support licensing in the same release.

Support will now be handled for paid customers. Any support requests asking for code , or any other type of support must purchase a 1 year support license.

languages are missing!

Hi Evan,

I have upgraded to the newest version of Timeline Express. I have noticed that the languages directory inside the plugin directory is missing.

Thanks,
Peshmerge

Option to always use local version of Font Awesome CSS

Currently, the plugin attempts to load a CDN-hosted copy of the Font Awesome CSS, and uses this version if available before falling back to the locally-hosted version.

It would be beneficial to be able to filter this choice so that the the local version can take priority over the CDN-hosted version, as if the CDN is slow then this holds up page render.

Happy to submit a PR if this is a reasonable request!

set_custom_icon_html_markup TODO

This code may be helpful in completing your documentation.

`add_image_size( 'timeline-img', 75, 75);

function set_custom_icon_html_markup() {
$post_id = get_the_ID();
$timeline_express_options = timeline_express_get_options();
$custom_icon_html = '';

if($custom_icon_url = wp_get_attachment_image_url( get_post_meta( $post_id, 'announcement_image_id', true ), 'timeline-img' )) {
    /* If read more visibility is set to true, wrap the icon in a link. */
    if ( '1' === $timeline_express_options['read-more-visibility'] ) {
        $custom_icon_html .= '<a class="cd-timeline-icon-link" href="' . esc_attr( apply_filters( 'timeline-express-read-more-link', esc_url( get_the_permalink( $post_id ) ) ) ) . '">';
    }

    $custom_icon_html .= '<div class="cd-timeline-img cd-picture" style="background: url(' . $custom_icon_url . ') center center no-repeat; background-size: contain;"></div>';

    /* If read more visibility is set to true, wrap the icon in a link. */
    if ( '1' === $timeline_express_options['read-more-visibility'] ) {
        $custom_icon_html .= '</a>';
    }

    echo $custom_icon_html;
}

return $custom_icon_html;

}

add_filter( 'timeline_express_custom_icon_html', 'set_custom_icon_html_markup' );`

To get this to work properly I needed to edit timeline_express_get_announcement_icon_markup() in helpers.php because there's a mixture of outputted content and returned content. There's probably a better solution if you want to change your core code.

if ( $custom_icon_html ) { return ''; }

Sorry for poor formatting, in a rush to submit.

Credit Card Charged 5 Times

Every time we went to purchase the pro version of Timeline Express it said the credit card could not be processed in red text. We attempted 5 times, same error. Now our credit card is charged 5 times and there is no way to reach you. Is this is a fraud or have you abandoned support for Timeline Express? Please check the support forum on WordPress and your personal website to contact us. We have started to dispute the charges and considering if this is fraud or not.

Better templating engine

Take a look at WooCommerce & Level Playing Field (by yikes inc.)

The templating engine should blend better with the given theme, instead of requiring users to create the custom template themselves.

Duplicate Images/Dates

When placing Timeline Express inside of a single post , images and dates are duplicated.

Something may be altering our query on the single-te_announcements.php template.

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.