Game of Thrones Lorem Ipsum Generator
See the Pen Game of Thrones Lorem Ipsum Generator by Digimix (@digimix) on CodePen.
See the Pen Game of Thrones Lorem Ipsum Generator by Digimix (@digimix) on CodePen.
Vertically center bootstrap modals without setting a height. Modal max-height will not exceed the window height with scrollable .modal-body and adapts on resize. You will need these JS and CSS snippets:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
function adjustModalMaxHeightAndPosition(){ $('.modal').each(function(){ if($(this).hasClass('in') === false){ $(this).show(); } var contentHeight = $(window).height() - 60; var headerHeight = $(this).find('.modal-header').outerHeight() || 2; var footerHeight = $(this).find('.modal-footer').outerHeight() || 2; $(this).find('.modal-dialog').addClass('modal-dialog-center').css({ 'margin-top': function () { var mH = $(this).outerHeight(); var wH = $(window).height(); return (mH < wH ) ? -( mH * 0.6): -( wH * 0.5) + 12; }, 'margin-left': function () { return -($(this).outerWidth() / 2); } }); if($(this).hasClass('in') === false){ $(this).hide(); } }); } if ($(window).height() >= 320){ $(window).resize(adjustModalMaxHeightAndPosition).trigger("resize"); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
.modal-dialog-center { margin: 0; margin-bottom: 12px; position: absolute; top: 50%; left: 50%; } .modal-footer { margin-top: 0; } @media (max-width: 767px) { .modal-dialog-center { width: 100%; } } |
View this on Codepen
Automatically change div height to be 100% height of the browser window on resize using jQuery. This will scale the referenced div to the height of your browser viewport/document/window height. This is important for resizable or responsive websites, and particularly … Continued
1 2 3 4 5 6 7 8 9 |
<?php $i = 0; while(conditionals...) { if (!$i++) echo "Show once."; $i++; } ?> |
Adding instagram photos to your website should be simple, whether it’s a wordpress or not. Unless you are familiar with javascript, it could be difficult to figure out how to get your instagram api feed loading in a lightbox or … Continued
If you would like to have a page or module that displays posts or custom posts sorted by the amount of favorites each post has, ie. sorting your posts query into lists like “Most popular posts” or “Most favorited posts”, … Continued
1 2 |
$termDescription = term_description( '', get_query_var( 'taxonomy' ) ); echo $termDescription; |
You don’t need to change the any variables here, if you are on the individual term page, WordPress will actually know what taxonomy it is using.
Replace your typical next and previous pagination ie:
1 2 3 4 5 6 7 8 |
<?php if ($wp_query->max_num_pages > 1) : ?> <nav class="post-nav"> <ul class="pager"> <li class="previous"><?php next_posts_link(__('← Older posts', 'roots')); ?></li> <li class="next"><?php previous_posts_link(__('Newer posts →', 'roots')); ?></li> </ul> </nav> <?php endif; ?> |
with the example as follows to create better pagination. PHP
1 2 3 4 5 6 7 8 9 |
<?php global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages ) ); ?> |
Would you like to have a page that lists all your post or custom post categories, while displaying each category’s “sub, related or corresponding” posts listed as hyperlinks – with each post link then linking to their respective single post … Continued
Line 5 and Line 8 should be edited to meet your needs. Line 5, $restrict, lists Links and Comments as the two menus to hide, add more or replace with the WP admin menu items you woud like to remain … Continued