Output shows a page instead of a list of blog postings

Turn your Settings->Reading Blog and Home page back to default. Front-page.php is pulling your homepage content instead of your posts because you’ve told it to in your settings. front-page.php could also display the latest posts on your homepage, but if you’ve altered the settings so that a Static Page is your homepage then this file … Read more

Auto Refresh Post List after X seconds

Your answer definitely falls within the realm of AJAX. If you are using a form, try setting the onsubmit eventListener equal to return false; (plus any other needed attributes) like so: <form onsubmit=”return false;”> Then you send a post and parse it with PHP and depending on your desired effect, and the input of the … Read more

Page template not displaying

This is less of an answer and more of a kind of troubleshooting aid… Add this function to your project (probably functions.php) and then call it from the top of every template file in your theme… /** * Outputs the name of the file as an HTML comment for easy-peesy troubleshooting. * * @param string … Read more

How can I use get_permalink() outside the loop?

Since you are calling get_permalink() outside of the loop, you need to define the post $id parameter. You can access the post ID outside of the loop by invoking the global $post object and then referencing it’s ID value. So your code would now look like this: <?php if ( ICL_LANGUAGE_CODE==’zh-hans’ ) : global $post; … Read more

How to sort posts in archive loop

This filter has to be set in functions.php. Your filter won’t work as expected because your condition is wrong. The condition here imply that you try to order pages (hierarchical post) instead of regular posts-like entries. You have to be careful using this filter as it has effect on your whole website. function my_custom_archive_order( $vars … Read more

Creating loop within functions.php

Just loop over WP_Query::$posts to get the titles: $option_posts = new WP_Query( [ ‘post_type’ => ‘organisationer’ ] ); $options = []; foreach ( $option_posts->posts as $post ) { $key = “option_{$post->ID}”; $options[ $key ] = apply_filters( ‘the_title’, $post->post_title ); } woocommerce_form_field_radio( ‘custom_field’, array( /* … */ ‘options’ => $options ), $checkout->get_value( ‘custom_field’ ) ); I’m … Read more

Loop through Navbar, Output Icons

There are 4 arguments that might help you with wp_nav_menu(): before – “(string) Text before the link text.” after – “(string) Text after the link text.” link_before – “(string) Text before the link.” link_after – “(string) Text after the link.”

Integrating Orbit slider into wordpress through custom post type

I have figured it out I started from scratch and created a custom loop with all the updated classes for the foundation orbit slider. If anyone would like the code please find it below: <?php $loop = new WP_Query( array( ‘post_type’ => ‘slides’, ‘posts_per_page’ => 999 ) ); ?> <div class=”orbit” role=”region” aria-label=”Favorite Space Pictures” … Read more