I got the evening off and I decided to rebuild my personal page. Will probably be adding some things to it, but I will try to keep it as clean as possible.
A Pen by Yahia Refaiea on CodePen.
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| //CSS | |
I got the evening off and I decided to rebuild my personal page. Will probably be adding some things to it, but I will try to keep it as clean as possible.
A Pen by Yahia Refaiea on CodePen.
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
| * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
| */ | |
| $args = array( |
| function fetch_modal_content() { | |
| if ( isset($_REQUEST) ) { | |
| $post_id = $_REQUEST['id']; | |
| ?> | |
| <div class="modal-body"> | |
| <h1><?php echo get_the_title($post_id); ?></h1> | |
| <?php echo wpautop(get_the_content($post_id)); ?> | |
| </div> |
| < ?php $myroles = array('photographer', 'general', 'makeup artist'); | |
| echo"<select name='list_of_roles'>"; | |
| foreach ($myroles as $myrole){ | |
| echo "<option value='$myrole'>$myrole</option>"; | |
| } | |
| echo "</select>"; ?> | |
| add_action(‘register_form’,’show_role_field’); |
| SET @oldsite='http://oldsite.com'; | |
| SET @newsite='http://newsite.com'; | |
| UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite); | |
| UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite); | |
| /* only uncomment next line if you want all your current posts to post to RSS again as new */ | |
| #UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite); |
| # compress text, html, javascript, css, xml: | |
| AddOutputFilterByType DEFLATE text/plain | |
| AddOutputFilterByType DEFLATE text/html | |
| AddOutputFilterByType DEFLATE text/xml | |
| AddOutputFilterByType DEFLATE text/css | |
| AddOutputFilterByType DEFLATE application/xml | |
| AddOutputFilterByType DEFLATE application/xhtml+xml | |
| AddOutputFilterByType DEFLATE application/rss+xml | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE application/x-javascript |
| //function to call first uploaded image in functions file | |
| function main_image() { | |
| $files = get_children('post_parent='.get_the_ID().'&post_type=attachment | |
| &post_mime_type=image&order=desc'); | |
| if($files) : | |
| $keys = array_reverse(array_keys($files)); | |
| $j=0; | |
| $num = $keys[$j]; | |
| $image=wp_get_attachment_image($num, 'large', true); | |
| $imagepieces = explode('"', $image); |
Пропустить теорию и перейти прямо к задачам
Ссылка на учебник: http://learn.javascript.ru
Сразу расскажу про несколько особенностей яваскрипта, о которых может быть не написано (или мало написано) в учебниках, но которые стоит понимать: