Skip to content

Instantly share code, notes, and snippets.

View crawlynoob's full-sized avatar
🎯
Focusing

crawlynoob

🎯
Focusing
View GitHub Profile
@maheshwaghmare
maheshwaghmare / sample-plugin.php
Created July 18, 2020 10:57
Sample Plugin - Create new user role and new post type and allow to create the custom post type with those users who have that specific user role.
<?php
<?php
/**
* Plugin name: Sample Plugin
*/
/**
* User Role Specific Post Type
*
* @package User Role Specific Post Type
@jawinn
jawinn / primary_category.php
Last active December 8, 2022 21:42
Display Primary Category (Yoast's WordPress SEO)
<?php
/**
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup.
* If there is no primary category set, it displays the first assigned category.
*
* @param boolean $useCatLink Whether to link the category, if it exists
* @return void
*/
function yourtheme_display_yoast_primary_category( $useCatLink = true ) {
@aibrean
aibrean / acf-modal-repeater.php
Created September 16, 2015 14:21
ACF Modals with repeater
<?php if (have_rows('action_buttons')) {
$counter = 1; ?>
<?php
while (have_rows('action_buttons')) {
the_row();
?>
<!--Trigger-->
<a href="#" data-reveal-id="Modal<?php echo $counter ?>" class="button small"><?php the_sub_field('trigger') ?></a>
<div id="Modal<?php echo $counter ?>" class="reveal-modal" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog" data-options="close_on_background_click:false">
<br>