Single post page from static home not working

See the change of get_permalink to the_permalink This might work for you. <?php $args = array( ‘numberposts’ => 5, ‘order’=> ‘ASC’, ‘orderby’ => ‘date’ ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <div class=”single_post”> <h3><?php the_date(); ?></h3> <h3> <a href=”https://wordpress.stackexchange.com/questions/109174/<?php the_permalink();?>”> <?php the_title(); ?> </a> </h3> <?php the_excerpt(); ?> </div> … Read more

changes to templates not showing on server

After many attempts, i had to make changes to the core template files in directory plugins/woocommerce and it worked, for safety i then copied the woocommerce/templates to mytheme/woocommerce/templates and surprisingly it worked! strange but at least it did.

How to output the content of a Custom Post Type from a drop down form?

This is going to be 1 part processing an array, and 1 part jQuery. <?php // assume you have a loop already $html_out=””; $select=”<select id=”office-chooser”>”; $select .= ‘<option value=””>Select an Office</option>’; while($loop->have_posts()) : $loop->the_post(); // add each div with excerp. It’s ID is unique and correlates to value of select drop down $html_out .= ‘<div … Read more

Howto put advertising as post number 1,2,3 etc

You can use this property of WP_Query: $current_post (available during The Loop) Index of the post currently being displayed. Let’s say you have your current version of loop: <?php while ( have_posts() ): the_post(); ?> … some code that is displaying current post <?php endwhile; ?> Change it to something like this: <?php while ( … Read more

How to filter posts by categories?

From Isotope Docs: HTML: <ul id=”filters”> <li><a href=”#” data-filter=”*”>show all</a></li> <li><a href=”#” data-filter=”.metal”>metal</a></li> <li><a href=”#” data-filter=”.transition”>transition</a></li> <li><a href=”#” data-filter=”.alkali, .alkaline-earth”>alkali and alkaline-earth</a></li> <li><a href=”#” data-filter=”:not(.transition)”>not transition</a></li> <li><a href=”#” data-filter=”.metal:not(.transition)”>metal but not transition</a></li> </ul> <div id=”container”> <div class=”element transition metal”>…</div> <div class=”element post-transition metal”>…</div> <div class=”element alkali metal”>…</div> <div class=”element transition metal”>…</div> <div class=”element lanthanoid metal … Read more