This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * The template for displaying all single posts | |
| * | |
| * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post | |
| * | |
| * @package WordPress | |
| * @subpackage Twenty_Twenty_One | |
| * @since Twenty Twenty-One 1.0 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($){ | |
| /** | |
| * initializeBlock | |
| * | |
| * Adds custom JavaScript to the block HTML. | |
| * | |
| * @date 15/4/19 | |
| * @since 1.0.0 | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <section class="projects-arc"> | |
| <?php | |
| $args = array( | |
| 'post_type' => 'project', | |
| 'post_status' => 'publish', | |
| 'order' => 'ASC', | |
| 'meta_key' => 'show_projects_archive', | |
| 'meta_value' => 'show', | |
| ); | |
| $project = new WP_Query( $args ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DO $$DECLARE r record; | |
| DECLARE | |
| v_schema varchar := 'public'; | |
| v_new_owner varchar := 'admin'; | |
| BEGIN | |
| FOR r IN | |
| select 'ALTER TABLE "' || table_schema || '"."' || table_name || '" OWNER TO ' || v_new_owner || ';' as a from information_schema.tables where table_schema = v_schema | |
| union all | |
| select 'ALTER TABLE "' || sequence_schema || '"."' || sequence_name || '" OWNER TO ' || v_new_owner || ';' as a from information_schema.sequences where sequence_schema = v_schema | |
| union all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| acf_form_head(); | |
| get_header(); | |
| //creating a frontend form | |
| $options = array( | |
| 'post_id' => 'new_post', | |
| 'post_title' => true, | |
| 'post_content' => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //print the student name & teacher name | |
| // | |
| $student = get_field('students'); | |
| ?> | |
| <h4> | |
| Student (Child name): <?php echo $student["child_name"]; ?> | |
| </h4> | |
| <?php | |
| $teachers = get_field('teachers_child_name'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $dateOfBirth = get_field('birth_date'); //date value returned in a valid date format | |
| $today = date("Y-m-d"); | |
| $diff = date_diff(date_create($dateOfBirth), date_create($today)); | |
| echo 'Age is '.$diff->format('%y'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //acf start code | |
| echo "<h3>ACF Repeater section</h3>"; | |
| if( have_rows('students') ): | |
| ?> | |
| <table> | |
| <td>Student Name</td><td>Student Age</td><td>Courses</td> | |
| <?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $wp_query; | |
| $post = $wp_query->post; | |
| $fw_og_title = get_field('og_title', $post->ID); | |
| $fw_og_description = get_field('og_description', $post->ID); | |
| $fw_og_image = get_field('og_image', $post->ID); | |
| $fw_og_image_width = get_field('og_image_width', $post->ID); | |
| $fw_og_image_height = get_field('og_image_height', $post->ID); | |
| $fw_og_url= get_field('og_url', $post->ID); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // filter | |
| function my_posts_where( $where ) { | |
| $where = str_replace("meta_key = 'locations_$", "meta_key LIKE 'locations_%", $where); | |
| return $where; | |
| } |