{"id":22293487,"url":"https://github.com/evanherman/timeline-express","last_synced_at":"2025-07-29T00:31:02.417Z","repository":{"id":21779666,"uuid":"25102023","full_name":"EvanHerman/timeline-express","owner":"EvanHerman","description":"Timeline express allows you to create a vertical animated and responsive timeline of posts, without writing a single line of code. Sweet!","archived":false,"fork":false,"pushed_at":"2023-01-11T18:50:10.000Z","size":8504,"stargazers_count":21,"open_issues_count":14,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T05:14:15.410Z","etag":null,"topics":["animated","font-awesome","php","timeline-express","timeline-plugin","vertical","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://www.wp-timelineexpress.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvanHerman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-12T01:18:12.000Z","updated_at":"2023-02-07T04:22:06.000Z","dependencies_parsed_at":"2023-01-13T21:40:29.107Z","dependency_job_id":null,"html_url":"https://github.com/EvanHerman/timeline-express","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanHerman%2Ftimeline-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanHerman%2Ftimeline-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanHerman%2Ftimeline-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanHerman%2Ftimeline-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvanHerman","download_url":"https://codeload.github.com/EvanHerman/timeline-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227965022,"owners_count":17848344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animated","font-awesome","php","timeline-express","timeline-plugin","vertical","wordpress","wordpress-plugin"],"created_at":"2024-12-03T17:29:20.357Z","updated_at":"2024-12-03T17:29:21.299Z","avatar_url":"https://github.com/EvanHerman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timeline Express - 1.8.1\n\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com)\n[![Build Status](https://travis-ci.org/EvanHerman/timeline-express.svg?branch=master)](https://travis-ci.org/EvanHerman/timeline-express)\n[![Code Climate](https://codeclimate.com/github/EvanHerman/timeline-express/badges/gpa.svg)](https://codeclimate.com/github/EvanHerman/timeline-express)\n[![Test Coverage](https://codeclimate.com/github/EvanHerman/timeline-express/badges/coverage.svg)](https://codeclimate.com/github/EvanHerman/timeline-express/coverage)\n[![Issue Count](https://codeclimate.com/github/EvanHerman/timeline-express/badges/issue_count.svg)](https://codeclimate.com/github/EvanHerman/timeline-express)\n[![Project Stats](https://www.openhub.net/p/timeline-express/widgets/project_thin_badge.gif)](https://www.openhub.net/p/timeline-express)\n\n[![Timeline Express](https://cldup.com/muOzYZg5GP.jpg)](https://www.wp-timelineexpress.com)\n\n**Tags:**              timeline, responsive, time, line, vertical, animated, company, history, font awesome, events, calendar, scroll, dates, story, timeline express, milestone, stories \u003cbr /\u003e\n**Requires at least:** WordPress v4.2 \u003cbr /\u003e\n**Tested up to:**      WordPress v5.0 \u003cbr /\u003e\n**Stable tag:**        1.8.1 \u003cbr /\u003e\n**License:**           GPLv2 or later \u003cbr /\u003e\n**License URI:**       [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)\n\n[![WordPress plugin](https://img.shields.io/wordpress/plugin/v/timeline-express.svg?style=flat-square)](https://wordpress.org/plugins/timeline-express/)\n[![WordPress](https://img.shields.io/wordpress/v/timeline-express.svg?style=flat-square)](https://wordpress.org/plugins/timeline-express/)\n[![WordPress](https://img.shields.io/wordpress/plugin/dt/timeline-express.svg?style=flat-square)](https://wordpress.org/plugins/timeline-express/)\n[![WordPress rating](https://img.shields.io/wordpress/plugin/r/timeline-express.svg?style=flat-square)](https://wordpress.org/support/plugin/timeline-express)\n\n\n## Description\n\n[Timeline Express](https://www.wp-timelineexpress.com) is a WordPress plugin that creates a vertical animated, responsive timeline of posts, in chronological order.\n\nTimeline 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.\n\nTimeline 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.\n\n\n## New Site \u0026 Documentation\n\nFor the new version of Timeline Express, we built out an entirely new site to showcase the features \u0026 add-ons of Timeline Express.\n\nAdditionally, the documentation for the new version of timeline express can be found at [WP Timeline Express](https://www.wp-timelineexpress.com/documentation).\n\n\n## Internationalization\n\nAll 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.\n\nIf you are multi-lingual, and want to help out with translations, feel free to [work with glotpress.org](https://translate.wordpress.org/projects/wp-plugins/timeline-express) to help provide additional translations!\n\nAdditionally, Timeline Express comes with **full WPML Support** and is the only timeline plugin [supported by WPML](https://wpml.org/plugin/timeline-express/).\n\nOther WordPress translation plugins will work just as well, including [Polylang](https://wordpress.org/plugins/polylang/) and [qtranslate](qTranslate).\n\n\n## FAQ and Documentation\n\n#### Custom Announcement Template\n\nCopy 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.\n\n#### Custom Single Announcement Template\n\nCopy 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.\n\nOr 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.\n\n#### Years Instead of Icons\n\nMany 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.\n\n```php\ndefine( 'TIMELINE_EXPRESS_YEAR_ICONS', true );\n```\n\nOnce 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 `.`\n\n#### Custom Container Classes\nAnother 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`.\n\nAdditionally, 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.\n\n```php\ndefine( 'TIMELINE_EXPRESS_CONTAINER_CLASSES', true );\n```\n\nOnce 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.\n\n#### Actions \u0026 Filters\nTimeline 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.\n\nFor a visual map of the locations of the hooks within the plugin, please see [this article](#).\n\n#### Adding Custom Metaboxes and Fields\nUsers 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.\n\nIf you need to add custom metaboxes, it is recommended that you hook into `timeline_express_metaboxes` and define your metaboxes.\n\n**Example**\n```php\n/**\n * Timeline Express Add Custom Metabox\n * @param  array $options Array of options for Timeline Express.\n */\nfunction define_new_metabox( $options ) {\n\t$announcement_custom_metabox = new_cmb2_box( array(\n\t\t'id'            =\u003e 'announcement_custom_metabox',\n\t\t'title'         =\u003e __( 'Announcement Custom Metabox', 'text-domain' ),\n\t\t'object_types'  =\u003e array( 'te_announcements' ), // Post type\n\t\t'context'       =\u003e 'advanced',\n\t\t'priority'      =\u003e 'high',\n\t\t'show_names'    =\u003e true, // Show field names on the left\n\t) );\n\t// Container class\n\t$announcement_custom_metabox-\u003eadd_field( array(\n\t\t'name' =\u003e __( 'Custom Field', 'text-domain' ),\n\t\t'desc' =\u003e __( 'Custom description.', 'text-domain' ),\n\t\t'id'   =\u003e 'announcement_custom_field',\n\t\t'type' =\u003e 'text',\n\t) );\n}\nadd_action( 'timeline_express_metaboxes', 'define_new_metabox' );\n```\n\nUsers 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-\u003eID, 'announcement_custom_field', true )`.\n\nBelow you'll find a complete list of Actions and Filters contained within the Timeline Express code base.\n\n### Filters\n\n`timeline_express_slug` or `timeline-express-slug` \u003csmall\u003e(legacy)\u003c/small\u003e\n\n- *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.\n- *Location:* `/timeline-express/lib/admin/cpt/cpt.announcements.php`\n- *Paramaters:* `$slug`\n- *Default:* 'announcement'\n\n*Example Usage*\n```php\n/**\n * Alter the default Timeline Express slug\n * Change 'announcement' to 'event'\n */\nfunction alter_timeline_express_slug( $slug ) {\n\t$slug = 'event';\n\treturn $slug;\n}\nadd_filter( 'timeline_express_slug', 'alter_timeline_express_slug' );\n```\n\n`timeline_express_singular_name`\n\n- *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](https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext) filter.\n- *Location:* `/timeline-express/lib/admin/cpt/cpt.announcements.php`\n- *Paramaters:* `$single_name`\n- *Default:* 'Announcement'\n\n*Example Usage*\n```php\n/**\n * Alter most instances of 'Announcement' in the dashboard.\n * Change 'Announcement' to 'Event'\n */\nfunction alter_timeline_express_single_name( $single_name ) {\n\t$single_name = 'Event';\n\treturn $single_name;\n}\nadd_filter( 'timeline_express_singular_name', 'alter_timeline_express_single_name' );\n```\n\n`timeline_express_plural_name`\n\n- *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](https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext) filter.\n- *Location:* `/timeline-express/lib/admin/cpt/cpt.announcements.php`\n- *Paramaters:* `$plural_name`\n- *Default:* 'Announcements'\n\n*Example Usage*\n```php\n/**\n * Alter most instances of 'Announcements' in the dashboard.\n * Change 'Announcements' to 'Events'\n */\nfunction alter_timeline_express_plural_name( $plural_name ) {\n\t$plural_name = 'Events';\n\treturn $plural_name;\n}\nadd_filter( 'timeline_express_plural_name', 'alter_timeline_express_plural_name' );\n```\n\n`timeline_express_admin_column_date_format`\n\n- *Description:* Use this filter to alter the date format inside of the admin table, listed in the 'Announcement Date' column.\n- *Location:* `/timeline-express/lib/admin/cpt/timeline-express-admin-columns.php`\n- *Paramaters:* `$date_format`\n- *Default:* `get_option( 'date_format' )` - WordPress date format set inside of your site settings.\n\n*Example Usage*\n```php\n/**\n * Alter the date format in the admin column 'Announcement Date'.\n * Set the date format to 'January 1st, 2016' eg: `F jS, Y`\n */\nfunction alter_timeline_express_admin_column_date_format( $date_format ) {\n\t$date_format = 'F jS, Y';\n\treturn $date_format;\n}\nadd_filter( 'timeline_express_admin_column_date_format', 'alter_timeline_express_admin_column_date_format' );\n```\n\n`timeline_express_custom_fields`\n\n- *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()`.\n- *Location:* `/timeline-express/lib/admin/metaboxes/metabox.announcements.php`\n- *Paramaters:* `$fields`\n- *Default:* Array of default Timeline Express fields.\n\n*Example Usage*\n```php\n/**\n * @todo\n * Define additional custom fields to display on the Timeline Express announcements.\n */\nfunction add_custom_timeline_express_fields( $fields ) {\n\t$fields[] = array();\n\treturn $fields;\n}\nadd_filter( 'timeline_express_custom_fields', 'add_custom_timeline_express_fields' );\n```\n\n`timeline_express_font_awesome_version`\n\n- *Description:* Specify which version of Font Awesome you want to use to display your icons. Defaults to 4.6.1 (or latest).\n- *Location:* `/timeline-express/lib/admin/metaboxes/partials/bootstrap-icon-dropdown.php`\n- *Paramaters:* `$font_awesome_version`\n- *Default:* Array of default Timeline Express fields.\n\n*Example Usage*\n```php\n/**\n * Specify Font Awesome version 4.4.0\n */\nfunction alter_timeline_express_font_awesome_version( $font_awesome_version ) {\n\t$font_awesome_version = '4.4.0';\n\treturn $font_awesome_version;\n}\nadd_filter( 'alter_timeline_express_font_awesome_version', 'timeline_express_font_awesome_version' );\n```\n\n`timeline_express_admin_render_date_format`\n\n- *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.\n- *Location:* `/timeline-express/lib/admin/metaboxes/partials/time-stamp-custom.php`\n- *Paramaters:* `$date_format`\n- *Default:* `get_option( 'date_format' )`\n\n*Example Usage*\n```php\n/**\n * Alter the way the date is rendered on the edit announcements page\n */\nfunction alter_timeline_express_admin_date_format( $date_format ) {\n\t$font_awesome_version = '4.4.0';\n\treturn $date_format;\n}\nadd_filter( 'timeline_express_admin_render_date_format', 'alter_timeline_express_admin_date_format' );\n```\n\n`timeline_express_announcement_query_args`\n\n- *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](https://codex.wordpress.org/Class_Reference/WP_Query).\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_args`, `$post`, `$atts`\n- *Default:* Array of query arguments. Variable, depending on the Timeline Express settings.\n\n*Example Usage*\n```php\n/**\n * Limit the Timeline to 5 announcements.\n */\nfunction alter_timeline_express_front_end_query( $announcement_args, $post, $atts ) {\n\t$announcement_args['posts_per_page'] = 5;\n\treturn $announcement_args;\n}\nadd_filter( 'timeline_express_announcement_query_args', 'alter_timeline_express_front_end_query', 10, 3 );\n```\n\n`timeline_express_icon`\n\n- *Description:* Alter the icon for ALL announcements globally, or for each individual announcement \u003csmall\u003e(using the `$post_id` variable)\u003c/small\u003e.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_icon`, `$post_id`\n- *Default:* The icon set when you created the announcement, under the 'Announcement Icon' setting.\n\n*Example Usage*\n```php\n/**\n * Set all icons to 'fa-reddit' (globally)\n */\nfunction alter_timeline_express_icon( $announcement_icon, $post_id ) {\n\t$announcement_icon = 'fa-reddit';\n\treturn $announcement_icon;\n}\nadd_filter( 'timeline_express_icon', 'alter_timeline_express_icon', 10, 2 );\n```\n\n`timeline_express_icon_color`\n\n- *Description:* Alter the color for ALL announcements globally, or for each individual announcement \u003csmall\u003e(using the `$post_id` variable)\u003c/small\u003e. **Note:** You should use a hex value.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_icon_color`, `$post_id`\n- *Default:* The color set when you created the announcement, under the 'Announcement Color' setting.\n\n*Example Usage*\n```php\n/**\n * Set all icons to #0000FF (blue) (globally)\n */\nfunction alter_timeline_express_icon_color( $announcement_icon_color, $post_id ) {\n\t$announcement_icon_color = '#0000FF';\n\treturn $announcement_icon_color;\n}\nadd_filter( 'timeline_express_icon_color', 'alter_timeline_express_icon_color', 10, 2 );\n```\n\n`timeline_express_date`\n\n- *Description:* Alter the date for ALL announcements globally, or for each individual announcement \u003csmall\u003e(using the `$post_id` variable)\u003c/small\u003e. To alter the date format, see the `timeline_express_date_format` filter.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$date_text`, `$post_id`\n- *Default:* The text of the returned and formatted announcement date.\n\n*Example Usage*\n```php\n/**\n * Alter the returned date text (globally)\n * Set it to 'Announcement Date : Date'\n */\nfunction alter_timeline_express_date_text( $date_text, $post_id ) {\n\t$date_text = 'Announcement Date : ' . $date_text;\n\treturn $date_text;\n}\nadd_filter( 'timeline_express_date', 'alter_timeline_express_date_text', 10, 2 );\n```\n\n`timeline_express_image`\n\n- *Description:* Alter the image for ALL announcements globally, or for each individual announcement \u003csmall\u003e(using the `$post_id` variable)\u003c/small\u003e. To alter the image **size** see the `timeline_express_announcement_img_size` filter.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$image_html`, `$post_id`\n- *Default:* The color set when you created the announcement, under the 'Announcement Color' setting.\n\n*Example Usage*\n```php\n/**\n * Remove the announcement images (globally)\n */\nfunction alter_timeline_express_image_html( $image_html, $post_id ) {\n\t$image_html = '';\n\treturn $image_html;\n}\nadd_filter( 'timeline_express_image', 'alter_timeline_express_image_html', 10, 2 );\n```\n\n`timeline_express_announcement_img_size` or `timeline-express-announcement-img-size` \u003csmall\u003e(legacy)\u003c/small\u003e\n\n- *Description:* Alter the image size for ALL announcements globally, or for each individual announcement \u003csmall\u003e(using the `$post_id` variable)\u003c/small\u003e. You can use any defined image size, or define your own image sizes using [add_image_size()](https://developer.wordpress.org/reference/functions/add_image_size/).\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$image_html`, `$post_id`\n- *Default:* 'timeline-express' - 350x x 120px Hard Cropped - Image size defined by the plugin itself.\n\n*Example Usage*\n```php\n/**\n * First define a custom image size, then and set our announcements to use the new image size.\n */\n\n // Register a new custom image size 'custom-size' - 750px x 300px Hard Cropped\n add_image_size( 'custom-size', '500', '300', true );\n\n// Use our new image size on the announcements\nfunction set_custom_timeline_express_image_size( $image_size, $post_id ) {\n\t$image_size = 'custom-size';\n\treturn $image_size;\n}\nadd_filter( 'timeline_express_announcement_img_size', 'set_custom_timeline_express_image_size', 10, 2 );\n```\n\n`timeline_express_read_more_link`\n\n- *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`.\n- *Location:* `/timeline-express/lib/helpers.php`\n- *Paramaters:* `$read_more_html`, `$post_id`\n- *Default:* HTML markup for the read more link\n\n*Example Usage*\n```php\n/**\n * Wrap the read more html in \u003cp\u003e tags and remove the elipses (...)\n */\nfunction custom_timeline_express_read_more_link( $read_more_html, $post_id ) {\n\t$read_more_html = '\u003cp\u003e' . str_replace( '...', '', $read_more_html ) . '\u003c/p\u003e';\n\treturn $read_more_html;\n}\nadd_filter( 'timeline_express_read_more_link', 'custom_timeline_express_read_more_link', 10, 2 );\n```\n\n`timeline_express_read_more_class`\n\n- *Description:* Alter the Timeline Express read more link class, or add additional classes.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$read_more_classes`, `$post_id`\n- *Default:* 'timeline-express-read-more-link'\n\n*Example Usage*\n```php\n/**\n * Add an additional class to the Timeline read more link.\n */\nfunction add_additional_read_more_link_classes( $read_more_classes, $post_id ) {\n\t$read_more_classes = $read_more_classes . ' custom-read-more-class';\n\treturn $read_more_classes;\n}\nadd_filter( 'timeline_express_read_more_class', 'add_additional_read_more_link_classes', 10, 2 );\n```\n\n`timeline_express_read_more_text`\n\n- *Description:* Alter the Timeline Express read more link text.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$read_more_text`, `$post_id`\n- *Default:* 'timeline-express-read-more-text'\n\n*Example Usage*\n```php\n/**\n * Set the read more link text from 'read more' to 'View this Announcement'\n */\nfunction alter_timeline_express_read_more_text( $read_more_text, $post_id ) {\n\t$read_more_text = 'View this Announcement';\n\treturn $read_more_text;\n}\nadd_filter( 'timeline_express_read_more_text', 'alter_timeline_express_read_more_text', 10, 2 );\n```\n\n`timeline_express_read_more_text`\n\n- *Description:* Alter the Timeline Express read more link text.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$read_more_text`, `$post_id`\n- *Default:* 'timeline-express-read-more-text'\n\n*Example Usage*\n```php\n/**\n * Set the read more link text from 'read more' to 'View this Announcement'\n */\nfunction alter_timeline_express_read_more_text( $read_more_text, $post_id ) {\n\t$read_more_text = 'View this Announcement';\n\treturn $read_more_text;\n}\nadd_filter( 'timeline_express_read_more_text', 'alter_timeline_express_read_more_text', 10, 2 );\n```\n\n`timeline_express_frontend_excerpt`\n\n- *Description:* Alter the Timeline Express excerpt text.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_excerpt`, `$post_id`\n- *Default:* The excerpt pulled from the current announcement.\n\n*Example Usage*\n```php\n/**\n * Set the timeline excerpt to something custom\n */\nfunction alter_timeline_express_custom_excerpt_text( $announcement_excerpt, $post_id ) {\n\t$announcement_excerpt = 'Custom Announcement Excerpt';\n\treturn $announcement_excerpt;\n}\nadd_filter( 'timeline_express_frontend_excerpt', 'alter_timeline_express_custom_excerpt_text', 10, 2 );\n```\n\n`timeline_express_random_excerpt`\n\n- *Description:* Alter the Timeline Express excerpt, when your announcements are set to random length.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_random_excerpt`, `$post_id`\n- *Default:* An excerpt of random length, pulled from the current announcement.\n\n*Example Usage*\n```php\n/**\n * Set the timeline random excerpt to something custom\n */\nfunction alter_timeline_express_custom_random_excerpt_text( $announcement_random_excerpt, $post_id ) {\n\t$announcement_random_excerpt = 'Custom Announcement Random Excerpt';\n\treturn $announcement_random_excerpt;\n}\nadd_filter( 'timeline_express_random_excerpt', 'alter_timeline_express_custom_random_excerpt_text', 10, 2 );\n```\n\n`timeline_express_random_excerpt_min`\n\n- *Description:* Alter the minimum value of the randomly generated text. The excerpt will be generated from a random number between 50 and 200.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_random_excerpt_min`, `$post_id`\n- *Default:* 50\n\n*Example Usage*\n```php\n/**\n * Set the minimum excerpt length to 20, when randomly generating the excerpt.\n */\nfunction alter_timeline_express_random_excerpt_min( $announcement_random_excerpt_min, $post_id ) {\n\t$announcement_random_excerpt_min = 20;\n\treturn $announcement_random_excerpt_min;\n}\nadd_filter( 'timeline_express_random_excerpt_min', 'alter_timeline_express_random_excerpt_min', 10, 2 );\n```\n\n`timeline_express_random_excerpt_max`\n\n- *Description:* Alter the maximum value of the randomly generated text. The excerpt will be generated from a random number between 50 and 200.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$announcement_random_excerpt_max`, `$post_id`\n- *Default:* 200\n\n*Example Usage*\n```php\n/**\n * Set the maximum excerpt length to 400, when randomly generating the excerpt.\n */\nfunction alter_timeline_express_random_excerpt_max( $announcement_random_excerpt_min, $post_id ) {\n\t$announcement_random_excerpt_max = 400;\n\treturn $announcement_random_excerpt_max;\n}\nadd_filter( 'timeline_express_random_excerpt_max', 'alter_timeline_express_random_excerpt_max', 10, 2 );\n```\n\n`timeline_express_compare_sign`\n\n- *Description:* Alter the compare sign of the WP_Query object, for the timeline.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$compare_sign`, `$post_id`\n- *Default:* Variable, based on the setting assigned to the 'Announcement Time Frame' setting. Possible: '\u003e', '', '\u003c='\n\n*Example Usage*\n```php\n/**\n * Adjust the compare sign of the WP_Query\n * Set to 'All Annoumcenets(Past+Future)' '\u003c='\n */\nfunction alter_timeline_express_query_compare_sign( $compare_sign, $post_id ) {\n\t$compare_sign = '\u003c=';\n\treturn $compare_sign;\n}\nadd_filter( 'timeline_express_compare_sign', 'alter_timeline_express_query_compare_sign', 10, 2 );\n```\n\n`timeline_express_html_comment`\n\n- *Description:* Alter the Timeline Express HTML comment generated below Timeline Express.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express-intialize.php`\n- *Paramaters:* `$timeline_express_comment`\n- *Default:* Current installed Timeline Express version with author attribution.\n\n*Example Usage*\n```php\n/**\n * Remove the HTML comment generated by Timeline Express\n */\nfunction remove_timeline_express_html_comment( $timeline_express_comment ) {\n\t$timeline_express_comment = '';\n\treturn $timeline_express_comment;\n}\nadd_filter( 'timeline_express_html_comment', 'remove_timeline_express_html_comment' );\n```\n\n`timeline_express_menu_cap`\n\n- *Description:* Alter who can access the Timeline Express admin menu, by [capability](https://codex.wordpress.org/Roles_and_Capabilities#Capabilities).\n- *Location:* `/timeline-express/lib/classes/class-timeline-express.php`\n- *Paramaters:* `$menu_cap`\n- *Default:* 'manage_options' - Site admins only\n\n*Example Usage*\n```php\n/**\n * Allow 'Editors', or users with the 'edit_posts' capability, access to Timeline Express.\n */\nfunction alter_timeline_express_admin_menu_cap( $menu_cap ) {\n\t$menu_cap = 'edit_posts';\n\treturn $menu_cap;\n}\nadd_filter( 'timeline_express_menu_cap', 'alter_timeline_express_admin_menu_cap' );\n```\n\n`timeline_express_tinymce_post_types`\n\n- *Description:* Alter which post types the Timeline Express tinyMCE button appears on.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express.php`\n- *Paramaters:* `$post_types_array`\n- *Default:* `array( 'page', 'post' )`\n\n*Example Usage*\n```php\n/**\n * Enable the Timeline Express tinyMCE button on the 'testimonials' post type.\n */\nfunction alter_timeline_express_tinymce_post_types( $post_types_array ) {\n\t$post_types_array[] = 'testimonials';\n\treturn $post_types_array;\n}\nadd_filter( 'timeline_express_tinymce_post_types', 'alter_timeline_express_tinymce_post_types' );\n```\n\n`timeline_express_single_content`\n\n- *Description:* Adjust the content on the single announcement template page.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express.php`\n- *Paramaters:* `$single_content`, `$post_id`\n- *Default:* Current announcement content.\n\n*Example Usage*\n```php\n/**\n * Append custom content onto the end of the content on the single announcement template.\n */\nfunction alter_timeline_express_single_template_content( $single_content, $post_id ) {\n\t$single_content = $single_content . ' | Custom content appended.';\n\treturn $single_content;\n}\nadd_filter( 'timeline_express_single_content', 'alter_timeline_express_single_template_content', 10, 2 );\n```\n\n`timeline_express_single_page_template` or `timeline-express-single-page-template` \u003csmall\u003e(legacy)\u003c/small\u003e\n\n- *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`.\n- *Location:* `/timeline-express/lib/classes/class-timeline-express.php`\n- *Paramaters:* `$single_template`\n- *Default:* Default template chosen to be used for single announcements. Possible: `single.php`, `page.php`, `/path/to/custom-template.php`\n\n*Example Usage*\n```php\n/**\n * Load a custom template called 'single-announcement-template.php' located in the theme root directory.\n */\nfunction set_timeline_express_single_template( $single_template ) {\n\t$single_template = get_stylesheet_directory() . 'single-announcement-template.php';\n}\nadd_filter( 'timeline_express_single_page_template', 'set_timeline_express_single_template' );\n```\n\n`timeline_express_custom_icon_html` or `timeline-express-custom-icon-html` \u003csmall\u003e(legacy)\u003c/small\u003e\n\n- *Description:* Use a custom icon in place of the default loaded one.\n- *Location:* `/timeline-express/lib/public/partials/timeline-express-container.php`\n- *Paramaters:* `$custom_icon_markup`, `$post_id` or `$post` (`$post_id` for new filter, `$post` (global post ojbect) for legacy filter)\n- *Default:* '' (empty). **Note:** Once markup is found, this will override the default icons.\n\n*Example Usage*\n```php\n/**\n * @todo\n * Use a custom icon instead of the standard Font Awesome icons\n */\nfunction set_custom_icon_html_markup( $post_id ) {\n\t/**\n\t * To do..\n\t */\n}\nadd_filter( 'timeline_express_custom_icon_html', 'set_custom_icon_html_markup' );\n```\n\n`timeline-express-announcement-container-class`\n\n- *Description:* Add additional classes to each announcement container on the time line.\n- *Location:* `/timeline-express/lib/public/partials/timeline-express-container.php`\n- *Paramaters:* `$class` \u0026 `$announcement_id`\n- *Default:* 'cd-timeline-block'.\n\n*Example Usage*\n```php\n/**\n * The following example will append 'custom-class' on to each announcement\n * container on the timeline.\n * @param string   $class             The default classes to filter.\n * @param integer  $announcement_id   The announcement ID to retrieve data from.\n */\npublic function add_additional_timeline_container_classes( $class, $announcement_id ) {\n\t$container_classes = array( $class );\n\t$container_classes[] = 'custom-class';\n\treturn implode( ' ', $container_classes );\n}\nadd_filter( 'timeline-express-announcement-container-class', 'add_additional_timeline_container_classes', 10, 2 );\n```\n\n### Actions\n\n`timeline_express_metaboxes`\n\n- *Description:* Define additional metaboxes on the announcement post new/edit screen.\n- *Location:* `/timeline-express/lib/admin/cpt/cpt.announcements.php`\n- *Paramaters:* `$options` - The array of Timeline Express options retreived from the databse.\n\n**Example**\n```php\n/**\n * Timeline Express Add Custom Metabox\n * @param  array $options Array of options for Timeline Express.\n */\nfunction define_new_timeline_express_metabox( $options ) {\n\t$announcement_custom_metabox = new_cmb2_box( array(\n\t\t'id'            =\u003e 'announcement_custom_metabox',\n\t\t'title'         =\u003e __( 'Announcement Custom Metabox', 'text-domain' ),\n\t\t'object_types'  =\u003e array( 'te_announcements' ), // Post type\n\t\t'context'       =\u003e 'advanced',\n\t\t'priority'      =\u003e 'high',\n\t\t'show_names'    =\u003e true, // Show field names on the left\n\t) );\n\t// Container class\n\t$announcement_custom_metabox-\u003eadd_field( array(\n\t\t'name' =\u003e __( 'Custom Field', 'text-domain' ),\n\t\t'desc' =\u003e __( 'Custom description.', 'text-domain' ),\n\t\t'id'   =\u003e 'announcement_custom_field',\n\t\t'type' =\u003e 'text',\n\t) );\n}\nadd_action( 'timeline_express_metaboxes', 'define_new_timeline_express_metabox' );\n```\n\nTo 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. \u003cbr /\u003e\u003csmall\u003eKeep 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](#test).\u003c/small\u003e\n\n```php\n/**\n * Display the new custom meta, at the top of our announcement container\n * @return string The contents of the new meta field.\n */\nfunction sample_use_custom_meta() {\n\tglobal $post;\n\techo wp_kses_post( '\u003cstrong\u003e' . timeline_express_get_custom_meta( $post-\u003eID, 'announcement_custom_field', true ) . '\u003c/strong\u003e' );\n}\nadd_action( 'timeline-express-container-top', 'sample_use_custom_meta' );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanherman%2Ftimeline-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanherman%2Ftimeline-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanherman%2Ftimeline-express/lists"}