Jump to Main Content
Capabilities
Front-end Development
CRO Web Design
Speed Optimization
Competency
Portfolio
Blog
About
Contact
Search
WordPress
Automatic link to blog post page
Add this code to your functions.php file: // Generate Link to posts page function archi_get_post_page_url() { if( 'page' == get_option( 'show_on_front
…
Read more
Automatically number each post in WordPress
In some cases I need to automatically number each post starting with the very first being number one. I’m not talking about using post ID here,
…
Read more
Displaying user info
Get current user’s info: <?php $current_user = wp_get_current_user(); // set variable echo 'Username: ' . $current_use
…
Read more
List all the children of parent page
When you visit the parent page, it will list all its children. Visiting the child page of the parent will show its siblings. <?php if($post->pos
…
Read more
Copy and/or move element(s) and display elsewhere
In the below script, the element #shopping-cart is copied (cloned) and then appended to the element #menu-button. jQuery(document).ready(function()
…
Read more
WordPress cheat sheet
This is my WordPress cheat sheet, these are a list of codes I’ve collected over the years for custom theme development. I will try to add explan
…
Read more
List posts by Category
What this does is prints out the heading of each category and lists only the posts in that category. Fill free to alter the loop to your needs, but ke
…
Read more
Add inline javascript to WordPress correctly
Add to functions.php file. Name the add_action whatever. You can also have the script load in the footer by changing wp_head to wp_footer. // Add JS t
…
Read more
Get the current page order number according to WordPress
This is useful for book chapter numbering if you don’t want to manually add the page number of a child in the title or wherever else: Example u
…
Read more
Get the current page and total number of pages in a paginated post in WordPress
<?php global $multipage; global $numpages; global $page; ?> <?php if ($multipage):?> <div class="page-numbering">Page <?php echo
…
Read more
1
2
3
Capabilities
Front-end Development
CRO Web Design
Speed Optimization
Competency
Portfolio
Blog
About
Contact