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 // additional loop via get_posts | |
| global $post; | |
| $args = array('category' => -9); // exclude Asides category | |
| $custom_posts = get_posts($args); | |
| foreach($custom_posts as $post) : setup_postdata($post); | |
| ... | |
| endforeach; | |
| ?> | |
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
| // element margins | |
| body * + * { | |
| margin-top: 1.5rem; | |
| } | |
| // grid | |
| .grid { | |
| display: flex; | |
| flex-flow: row wrap; | |
| } |
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 // display random posts | |
| $home_brew = new WP_Query('showposts=3&orderby=rand'); | |
| while($home_brew->have_posts()) : $home_brew->the_post(); | |
| // output custom stuff here! Post title, content, custom elds.. | |
| endwhile; | |
| wp_reset_postdata(); | |
| ?> |
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
| // Put this PHP code into your functions.php le. | |
| // This will load the jQuery library onto your page by inserting a link in the <head> section where you call wp_head. | |
| if(!is_admin()) { | |
| wp_deregister_script('jquery'); | |
| wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/ | |
| jquery/1.3.2/jquery.min.js"), false, '1.3.2'); | |
| wp_enqueue_script('jquery'); | |
| } |
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
| var link = document.createElement('a'); | |
| link.href = 'images.jpg'; | |
| link.download = 'Download.jpg'; | |
| document.body.appendChild(link); | |
| link.click(); |
OlderNewer