{"id":48465511,"url":"https://github.com/sectsect/cfs-loop-field-query","last_synced_at":"2026-04-07T04:31:02.035Z","repository":{"id":62541798,"uuid":"41863781","full_name":"sectsect/cfs-loop-field-query","owner":"sectsect","description":" Modify the Query to Multiple Dates in a post For Custom Field Suite \"Loop Field\".","archived":false,"fork":false,"pushed_at":"2019-05-24T18:40:45.000Z","size":739,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-30T12:40:03.711Z","etag":null,"topics":["calendar","cfs","event","loop-field","plugins","query","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sectsect.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-03T14:19:06.000Z","updated_at":"2024-05-23T18:07:17.000Z","dependencies_parsed_at":"2022-11-02T16:16:29.846Z","dependency_job_id":null,"html_url":"https://github.com/sectsect/cfs-loop-field-query","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/sectsect/cfs-loop-field-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fcfs-loop-field-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fcfs-loop-field-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fcfs-loop-field-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fcfs-loop-field-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sectsect","download_url":"https://codeload.github.com/sectsect/cfs-loop-field-query/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sectsect%2Fcfs-loop-field-query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["calendar","cfs","event","loop-field","plugins","query","wordpress"],"created_at":"2026-04-07T04:31:01.568Z","updated_at":"2026-04-07T04:31:02.029Z","avatar_url":"https://github.com/sectsect.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://github-sect.s3-ap-northeast-1.amazonaws.com/logo.svg\" width=\"28\" height=\"auto\"\u003e CFS Loop Field Query - For Events -\n\n### Modify the Query to multiple dates in a post For [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/) \"Loop Field\".\n\n## Features\n\nFor each `Date and Time` set in the `Loop Field`, only the scheduled events are output to Archive Page.\n\n- The `Date and Time` set in the `Loop Field` is outputted as `one event`.\n- Displayed in order of the most recent event (`ASC`).\n- Closed events is not outputted.\n- Supply a `function` for calendar :date:\n\n## Requirements\n\n* PHP 5.3+\n* Activation [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/) Plugin.\n* Create a Loop Field and Date Field in the Loop Field using [CFS](https://wordpress.org/plugins/custom-field-suite/) Plugin.\n* A 6-pack of beer🍺 (optional, I guess.)\n\n## Installation\n\n\n 1. `cd /path-to-your/wp-content/plugins/`\n 2. `git clone git@github.com:sectsect/cfs-loop-field-query.git`\n 3. Activate the plugin through the 'Plugins' menu in WordPress.  \n You can access the some setting by going to `Settings` -\u003e `CFS Loop Field Query`.\n 4. Setting `Post Type Name`, `Loop Field Name`, `Date Field Name` in Loop Feld\".  \n ( Optional Field: `Taxonomy Name`, `StartTime Field`, `FinishTime Field` )  \n That's it:ok_hand: The main query of your select post types will be modified.\n\n## Fields Structure Example\n\n \u003cimg src=\"https://github-sect.s3-ap-northeast-1.amazonaws.com/cfs-loop-field-query/screenshot.png\" width=\"789\" height=\"245\"\u003e\n\n## TIP\n\n* If you want to apply to some existing article, resave the article.  \n* This Plugin includes adding Time-Picker Field in CFS. (Using [CFS Time picker add-on](https://github.com/ersoma/cfs-time))\n* Support Pages for `is_date()` includes `is_year()` `is_month()` `is_day()`.\n* If you have set the 'FinishTime', it does not appear that post when it passes your set time. (Default: The Day Full)\n\n## Usage Example\n\nYou can get a sub query with `new CFS_LFQ_Query()`\n\n#### Example: Sub Query\n``` php\n\u003c?php\n    $ary     = array();\n    $page    = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\n    $perpage = 10;\n    $offset  = ( $page - 1 ) * $perpage;\n    $args    = array(\n        'posts_per_page' =\u003e $perpage\n    );\n    $query = new CFS_LFQ_Query( $args );\n?\u003e\n\u003c?php if ( $query-\u003ehave_posts() ) : while ( $query-\u003ehave_posts() ) : $query-\u003ethe_post(); ?\u003e\n    // something\n\u003c?php endwhile; ?\u003e\n\u003c?php endif;?\u003e\n\u003c?php wp_reset_postdata(); ?\u003e\n```\n#### Example: Sub Query For Calendar w/ `cfs_lfq_calendar()`  \n``` php\n$dates   = array();\n$args    = array(\n    'posts_per_page' =\u003e -1,\n    'calendar'       =\u003e true,       // Get the data for Not from the day but from the first day of the month.\n);\n$query = new CFS_LFQ_Query( $args );\nif ( $query-\u003ehave_posts() ) { while ( $query-\u003ehave_posts() ) { $query-\u003ethe_post();\n    $date = date( 'Ymd', strtotime( $post-\u003edate ) );\n    array_push( $dates, $date );\n}}\nwp_reset_postdata();\n\n// Passing array to cfs_lfq Calendar Class.\n$dates  = array_unique( $dates );\t\t// Remove some Duplicate Values(Day)\n$months = get_months_from_now( 3 );\n$args = array(\n    'dates'        =\u003e $dates,\t\t// (array) (required) Array of event Date ('Ymd' format)\n    'months'       =\u003e $months,\t\t// (array) (required) Array of month to generate calendar ('Ym' format)\n    'weekdayLabel' =\u003e 'default',\t// (string) (optional) Available value: 'default' or 'en' Note: 'default' is based on your wordpress locale setting.\n    'weekdayBase'  =\u003e 0,\t\t// (integer) (optional) The start weekday. 0:sunday ～ 6:saturday Default: 0\n    'element'      =\u003e 'div',\t\t// (string) (optional) The element for wraping. Default: 'div'\n    'class'        =\u003e ''\t\t// (string) (optional) The 'class' attribute value for wrap element. Default: ''\n);\ncfs_lfq_calendar( $args );\n```\n#### Example: Sub Query For Calendar w/ `Your Calendar Class`\n``` php\n$ary     = array();\n$args    = array(\n    'posts_per_page' =\u003e -1,\n    'calendar'       =\u003e true\t\t// Get the data for Not from the day but from the first day of the month.\n);\n$query = new CFS_LFQ_Query( $args );\nif ( $query-\u003ehave_posts() ) { while ( $query-\u003ehave_posts() ) { $query-\u003ethe_post();\n    $date    = date( 'Ymd', strtotime( $post-\u003edate ) );\n    $post_id = $post-\u003eID;\n    $perm    = get_the_permalink();\n    $title   = get_the_title();\n    array_push( $ary, array('date' =\u003e $date, 'id' =\u003e $post_id, 'permlink' =\u003e $perm, 'title' =\u003e $title) );\n}}\nwp_reset_postdata();\n\n// Passing array to your Calendar Class.\nrequire_once 'Calendar/Month/Weeks.php';\ncalendar( $ary, 0 );\n```\n#### Example: Get the \"Date\", \"StartTime\" and \"FinishTime\"\n``` php\n\u003cdiv id=\"date\"\u003e\n    \u003c?php echo date( 'Y-m-d', strtotime( $post-\u003edate ) ); ?\u003e\n\u003c/div\u003e\n\u003ctime\u003e\n    \u003c?php echo date( \"H:i\", strtotime( $post-\u003estarttime ) ); ?\u003e ~ \u003c?php echo date( \"H:i\", strtotime( $post-\u003efinishtime ) ); ?\u003e\n\u003c/time\u003e\n```\n\n## function\n\n#### get_months_from_now($num)  \n##### Parameters\n\n* **num**\n(integer) (required) Number of months to get.  \nDefault: `1`\n\n##### Return Values\n\n(array)  \n`Ym` formatted.\n\n```php\n$months = get_months_from_now( 3 );\n```\n\n\n#### cfs_lfq_calendar($args)  \n##### Parameters\n\n* **dates**\n(array) (required) Array of event Date (`Ymd` format).\n\n* **months**\n(array) (required) Array of month to generate calendar (`Ym` format)\n\n* **weekdayLabel**\n(string) (optional) Available value: `'default'` or `'en'`.  \nDefault: `'default'`  \n:memo: `'default'` is based on your wordpress locale setting.\n\n* **weekdayBase**\n(integer) (optional) The start weekday. `0:sunday ～ 6:saturday`  \nDefault: `0`\n\n* **element**\n(string) (optional) The element for wraping.  \nDefault: `'div'`\n\n* **class**\n(string) (optional) The 'class' attribute value for wrap element.  \nDefault: `''`\n\n##### Example\n\n```php\n$args = array(\n\t'dates'        =\u003e $dates,\n\t'months'       =\u003e $months,\n\t'weekdayLabel' =\u003e 'default',\n\t'weekdayBase'  =\u003e 0,\n\t'element'      =\u003e 'div',\n\t'class'        =\u003e 'myclass'\n);\ncfs_lfq_calendar( $args );\n```\n\n## NOTES for Developer\n\n* This Plugin does not hosting on the [wordpress.org](https://wordpress.org/) repo in order to prevent a flood of support requests from wide audience.\n\n## Change log  \n\nSee [CHANGELOG](https://github.com/sectsect/cfs-loop-field-query/blob/master/CHANGELOG.md) file.\n\n## Contributing\n\n1. Create an issue and describe your idea\n2. [Fork it](https://github.com/sectsect/cfs-loop-field-query/fork)\n3. Create your feature branch (`git checkout -b my-new-feature`)\n4. Commit your changes (`git commit -am 'Add some feature'`)\n5. Publish the branch (`git push origin my-new-feature`)\n6. Create a new Pull Request\n7. Profit! :white_check_mark:\n\n## License\nSee [LICENSE](https://github.com/sectsect/cfs-loop-field-query/blob/master/LICENSE) file.\n\n## Related Plugin\nI also have plugin with the same functionality for [Advanced Custom Field](https://wordpress.org/plugins/advanced-custom-fields/) Plugin.  \n#### \u003cimg src=\"https://github-sect.s3-ap-northeast-1.amazonaws.com/github.svg\" width=\"22\" height=\"auto\"\u003e [ACF Repeater Field Query](https://github.com/sectsect/acf-repeater-field-query)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectsect%2Fcfs-loop-field-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsectsect%2Fcfs-loop-field-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsectsect%2Fcfs-loop-field-query/lists"}