Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                //********************************************************************************/
//EXPORT ALL WORDPRESS POST URLS USING CONSOLE
//List al WordPress post URLs using WP API
//https://responsive-muse.com/export-any-wordpress-post-urls-using-console-and-javascript/
//Paste the code below in the console (F12)
//Tested in Chrome in June 2023, but should work in any browser
//Video tutorial and support available at https://youtu.be/zUzPSfgWZXE
//Code created by Netgrows Tech. Visit us at https://responsive-muse.com & https://netgrows.com

//Code 1: List first 100 WordPress post URLs using WP API
//IMPORTANT: Use it on the homepage of any WordPress site

let wpUrl = window.location.href;
let wpApiUrl = wpUrl + 'wp-json/wp/v2/posts?per_page=100&page=1';
let arrayPosts = [];
fetch(wpApiUrl)
.then(response => response.json())
.then(json => {
    for (const post of json) {
        arrayPosts.push(post.link);
    }
})
.then(() => {
    console.log(arrayPosts.join('\n'));
});


//Code 2: List N pages of 100 WordPress post URLs using WP API
//Increase the totalPages variable to the number of pages you want to list (100 posts per page)
//Example: 3 totalPages of 100 posts each = 300 posts URLs  

let totalPages=3;
let wpUrl = window.location.href;
let arrayPosts = [];
for (let i = 1; i <= totalPages; i++) {
    let wpApiUrl = wpUrl + 'wp-json/wp/v2/posts?per_page=100&page=' + i;
    fetch(wpApiUrl)
    .then(response => response.json())
    .then(json => {
        for (const post of json) {
            arrayPosts.push(post.link);
        }
    })
    .then(() => {
        if (i === totalPages) console.log(arrayPosts.join('\n'));
    });
}
              
            
!
999px

Console