{"id":21813094,"url":"https://github.com/webdevstudios/wp-caroufredsel","last_synced_at":"2025-04-13T23:25:57.637Z","repository":{"id":6765458,"uuid":"8012138","full_name":"WebDevStudios/WP-carouFredSel","owner":"WebDevStudios","description":"Simple plugin that will A) enqueue carouFredSel when requested, and B) (if requested) create a custom \"featured\" post type for the carousel","archived":false,"fork":false,"pushed_at":"2013-06-18T14:05:14.000Z","size":296,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-22T01:37:27.241Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/WebDevStudios.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":"2013-02-04T17:20:19.000Z","updated_at":"2017-04-08T16:19:49.000Z","dependencies_parsed_at":"2022-09-18T11:23:58.673Z","dependency_job_id":null,"html_url":"https://github.com/WebDevStudios/WP-carouFredSel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWP-carouFredSel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWP-carouFredSel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWP-carouFredSel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FWP-carouFredSel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDevStudios","download_url":"https://codeload.github.com/WebDevStudios/WP-carouFredSel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248795405,"owners_count":21162768,"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":[],"created_at":"2024-11-27T14:27:11.008Z","updated_at":"2025-04-13T23:25:57.606Z","avatar_url":"https://github.com/WebDevStudios.png","language":"JavaScript","readme":"WP-carouFredSel\n===============\n\nSimple plugin that will A) enqueue carouFredSel when requested, and B) (if requested) create a custom \"featured\" post type for the carousel\n\n### To enqueue carouFredSel:\nIn your theme functions file or plugin, place the function\n```php\nwds_caroufredsel();\n```\n\n### To configure a carouFredSel instance:\n```php\nwds_caroufredsel( '#element' );\n```\n\n### To pass configuration parameters to the carouFredSel instance:\n```php\n$args = array(\n\t'width' =\u003e 870,\n\t'items' =\u003e 8,\n\t'scroll' =\u003e 4\n);\nwds_caroufredsel( '#element', $args );\n```\n\n### To enable a featured custom post type:\n```php\nwds_enable_cfs_cpt();\n```\n\n### To grab data (wrapped in a transient) from the featured custom post type:\n```php\nwds_fcs_get_featured();\n```\n\n### wds_fcs_get_featured() takes 3 arguments:\n\n**$WP_Query_args:** pass any WP_Query arguments you want that aren't in the default\nDefault: array(\n\t'post_type' =\u003e 'featured-entries',\n\t'posts_per_page' =\u003e 5,\n\t'post_status'    =\u003e 'publish',\n\t'no_found_rows'  =\u003e true,\n)\n\n**$return_full_query:** whether to return the query from WP_Query or a subset of the data (Title, link meta, content, and featured image)\nDefault: false (return the subset of data instead of the full query)\n\n**$use_transient:** Whether to wrap data in a transient to save on load time and queries to the database. The transient resets when a featured entry is saved in the admin.\nDefault: true (use transient)\n\n### To grab data (wrapped in a transient) from featured custom post type and then display it in a carouFredSel instance:\n```php\n// Assumes you have 'wds_enable_cfs_cpt();' in your themes functions file.\n\n/**\n * Enqueu carouFredSel and loop through our featured posts\n */\nfunction dma_loop_featured() {\n\t// make sure our plugin is activated\n\tif ( !function_exists('wds_fcs_get_featured') )\n\t\treturn;\n\t$featured = wds_fcs_get_featured();\n\t// if our query is empty, bail here\n\tif ( !$featured )\n\t\treturn;\n\t?\u003e\n\t\u003cdiv class=\"wds-featured-wrap\"\u003e\n\t\t\u003cul class=\"wds-featured\"\u003e\n\t\t\u003c?php\n\t\tforeach ( $featured as $id =\u003e $feature ) {\n\n\t\t\t// feature's image\n\t\t\t$html = wds_maybe_link( $feature, 'image' );\n\t\t\t// feature's title\n\t\t\t$html .= wds_maybe_link( $feature, 'title', 'h2' );\n\t\t\t// feature's content\n\t\t\t$html .= wds_maybe_link( $feature, 'content' );\n\n\t\t\techo '\u003cli\u003e'. $html .'\u003c/li\u003e';\n\t\t}\n\t\t?\u003e\n\t\t\u003c/ul\u003e\u003c!-- .wds-featured --\u003e\n\t\u003c/div\u003e\u003c!-- .wds-featured-wrap --\u003e\n\n\t\u003c?php\n\t// enqueue carouFredSel and configure its options\n\twds_caroufredsel( '.wds-featured', array(\n\t\t'width' =\u003e 572,\n\t\t'items' =\u003e 1,\n\t\t'scroll' =\u003e 1,\n\t\t'scroll' =\u003e array(\n\t\t\t'fx' =\u003e 'crossfade'\n\t\t),\n\t\t'auto' =\u003e array(\n\t\t\t'easing' =\u003e 'linear',\n\t\t\t'duration' =\u003e 1000,\n\t\t\t'timeoutDuration' =\u003e 2000,\n\t\t\t'pauseOnHover' =\u003e true\n\t\t),\n\t) );\n\n}\n\n/**\n * Wrap feature in url if it has one\n */\nfunction wds_maybe_link( $feature, $index, $wrap = false ) {\n\n\tif ( !$index )\n\t\treturn '';\n\n\tif ( !$feature['url'] )\n\t\treturn $feature[$index];\n\n\t$html = '\u003ca class=\"'. $index .'\" href=\"'. $feature['url'] .'\"\u003e'. $feature[$index] .'\u003c/a\u003e';\n\tif ( $wrap )\n\t\t$html = '\u003c'. $wrap .'\u003e'. $html .'\u003c/'. $wrap .'\u003e';\n\n\treturn $html;\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fwp-caroufredsel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdevstudios%2Fwp-caroufredsel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fwp-caroufredsel/lists"}