An example of logic to print paging numbers. You could take this further by adding ellipsis on either side or showing pages 1-5 and n-last at all times. But that's a bit too advanced for what this is demonstrating.
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
function goToByScroll(id) { | |
'use strict'; | |
// Assign the HTML, Body as a variable... | |
var $viewport = $('html, body'); | |
$viewport.animate({ | |
scrollTop: $("#" + id).offset().top // set scrollTarget to your desired position | |
}, 1000); |
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 | |
/** | |
* Generate paging for indexes of content | |
* @param object $node Node object | |
* @param array $q Array of query string values | |
* @param integer $current Current Page (0 based) | |
* @param integer $page_count Page Count | |
* @param boolean $ellipsis Show ellipsis between page numbers (to reduce width) (only for more than 9 pages) | |
* @return void Outputs markup to page |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
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
SELECT * FROM wp_posts as posts | |
WHERE posts.post_type = 'post' | |
AND NOT EXISTS ( | |
SELECT * FROM `wp_postmeta` | |
WHERE `wp_postmeta`.`meta_key` = "your_meta_key" | |
AND `wp_postmeta`.`post_id`=posts.ID | |
) |
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
// jquerify.js | |
// https://github.com/bgrins/devtools-snippets | |
// Add jQuery to any page that does not have it already. | |
(function () { | |
if ( !window.jQuery ) { | |
var s = document.createElement('script'); | |
s.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'); | |
document.body.appendChild(s); |
OlderNewer