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
/* ------------------------------------ | |
Gravity Forms | |
---------------------------------------*/ | |
.gform_wrapper ul { padding-left: 0; list-style: none } | |
.gform_wrapper li { margin-bottom: 15px } | |
.gform_wrapper form { margin-bottom: 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
<?php | |
/** | |
* short_content generator | |
* @param string $mycontent content string | |
* @param string $after | |
* @param int $length | |
* @return string | |
*/ | |
function short_content( $mycontent, $after = '', $length ) { |
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 | |
/** Functions available | |
* have_rows() | |
* has_sub_field() | |
* get_sub_field() | |
* the_sub_field() | |
*/ | |
?> | |
<?php if( have_rows( 'repeater_field_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 | |
/** | |
* ======== acf option page customization ======== | |
* @param [type] $settings | |
* @return [type] | |
*/ | |
function my_acf_options_page_settings( $settings ) | |
{ | |
$settings['title'] = 'Page Title'; | |
$settings['menu'] = 'Menu Title'; |
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 | |
/** Wordpress general query | |
* http://codex.wordpress.org/Class_Reference/WP_Query | |
* */ | |
// WP_Query arguments | |
$custom_args = array ( 'post_type' => 'custom_post', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => '5', 'order' => 'DESC', 'orderby' => 'date', ); | |
// The Query | |
$custom_query = new WP_Query( $custom_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
#add www.infront of urls | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^([^.]+\.[a-z]{2,6})$ [NC] | |
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] |
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 | |
if ($post->post_parent) : | |
$ancestors = get_post_ancestors($post->ID); //get all parent post ids in an array | |
$root = count($ancestors)-1; //find the count | |
$parent = $ancestors[$root]; //get top parent id | |
else: |
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 | |
/** | |
* list taxonomy accoeding to the custom post type | |
* @var [string] | |
* ref: http://codex.wordpress.org/Template_Tags/wp_list_categories | |
*/ | |
$custom_taxonomy = get_object_taxonomies('taxonomy-slud-or-id'); | |
if(count($custom_taxonomy) > 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
<?php | |
//Define the function for customize archive page | |
function your_taxonomy_archive_customization ( $query ) { | |
if (($query->is_main_query()) && (is_tax('your_custon_taxonomy'))) { | |
$query->set( 'posts_per_page', '3' ); | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} |
OlderNewer