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 | |
| // Yoink: https://community.gravityforms.com/t/how-to-display-us-as-the-first-choice-but-leave-the-default-country-field-blank/17226/2 | |
| /** | |
| * Set US to top of countries list in Gravity Forms. | |
| */ | |
| // Normal way | |
| add_filter( 'gform_countries', 'modify_countries_list' ); |
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
| United States|US | |
| Canada|CA | |
| Afghanistan|AF | |
| Aland Islands|AX | |
| Albania|AL | |
| Algeria|DZ | |
| Andorra|AD | |
| Angola|AO | |
| Anguilla|AI | |
| Antarctica|AQ |
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
| Alabama|AL | |
| Alaska|AK | |
| American Samoa|AS | |
| Arizona|AZ | |
| Arkansas|AR | |
| California|CA | |
| Colorado|CO | |
| Connecticut|CT | |
| Delaware|DE | |
| District of Columbia|DC |
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
| import requests, csv, time, re | |
| from bs4 import BeautifulSoup | |
| def get_page_id(url): | |
| page = requests.get(url) | |
| raw = page.text | |
| soup = BeautifulSoup(raw, 'html.parser') | |
| body = soup.find("body") | |
| for i in body["class"]: |
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 | |
| // add to functions.php | |
| // Yoink: https://wordpress.stackexchange.com/a/130921 | |
| function show_template() { | |
| if( is_super_admin() ){ | |
| global $template; | |
| print_r($template); | |
| } | |
| } |
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 | |
| /* | |
| Template Name: Blog Archive | |
| Author: kbcarte | |
| */ | |
| get_header(); | |
| ?> |
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 | |
| // Yoink https://wordpress.stackexchange.com/a/154364 | |
| if ( ! function_exists( 'pagination' ) ) { | |
| function pagination( $paged = '', $max_page = '' ) { | |
| $big = 999999999; // need an unlikely integer | |
| if( ! $paged ) { | |
| $paged = get_query_var('paged'); | |
| } |
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 | |
| /* Place in functions.php */ | |
| function prefix_filter_canonical_example( $canonical ) { | |
| if ( substr( $canonical, -1 ) == "/" ) { | |
| return substr($canonical, 0, -1); | |
| } | |
| return $canonical; | |
| } | |
| add_filter( 'wpseo_canonical', 'prefix_filter_canonical_example' ); |
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 | |
| // example of FL | |
| $imports = array('Brooksville','Spring Hill','New Port Richey','Hudson','Port Richey','Holiday','Dade City','Zephyrhills','Wesley Chapel','San Antonio','Kathleen','Webster','Saint Petersburg','Clearwater','Clearwater Beach','Largo','Seminole','Pinellas Park','Palm Harbor','Tarpon Springs','Safety Harbor','Dunedin','Odessa','Lutz','Tampa','Land O Lakes','Thonotosassa','Plant City','Lakeland','Auburndale','Bartow','Eagle Lake','Mulberry','Winter Haven','Brandon','Dover','Gibsonton','Lithia','Riverview','Ruskin','Apollo Beach','Sun City Center','Seffner','Valrico','Wimauma','Palmetto'); | |
| foreach( $imports as $i ){ | |
| $page_id = wp_insert_post( | |
| array( | |
| 'comment_status' => 'close', | |
| 'ping_status' => 'close', |
NewerOlder