Get_header raises an 500 internal server error
If you want to create one template in WordPress, Please see below example <?php /* Template Name: CustomPageT1 */ get_header(); echo “hello this is my custom template”; get_footer(); ?> Try this code.
If you want to create one template in WordPress, Please see below example <?php /* Template Name: CustomPageT1 */ get_header(); echo “hello this is my custom template”; get_footer(); ?> Try this code.
There’s two issues at play here. First, you’ve got two sets of parentheses: ↓ Here ↓ And Here echo ‘<div>(‘ . comments_number( ‘(0) ‘, ‘(1)’, ‘(%)’ ) . ‘)</div>’; You only want one. Second, you’re trying to concatenate a string (.) with a function, comments_number(), that echoes. This results in comments_number() being outut immediately, and … Read more
Child theme overirde template-tags in a theme built on underscores in inc/template-tags
Basically, you just need to check if the $links variable is not empty and if so, then echo the text Tag: and the $links (i.e. the terms list): if ( ! empty( $links ) ) { echo ‘Tags: ‘ . implode( ‘, ’, $links ); } Or a better version, check if the $terms is not … Read more
Found it: The posts I’m working with are instances of custom posts, and the default get_posts() function assumes that posts are just, well, posts. So it wasn’t finding them, and was properly returning “none”. Solution: I added some code to my theme’s function.php file, like so: function set_up_theme() { …other stuff function mytheme_pre_get_posts () $query->set(‘post_type’, … Read more
How to Rearrange WordPress Tags list on frontend using Shortcode with specific order?
Just create a template file called “category-ontario-ohs-reform-alerts.php”. This way any time this category is displayed, your special template will be used.
This is straight from the WordPress codex <?php $arc_year = get_the_time(‘Y’); ?> <?php $arc_month = get_the_time(‘m’); ?> <a href=”https://wordpress.stackexchange.com/questions/18602/<?php echo get_month_link($arc_year, $arc_month); ?>”>archive for <?php the_time(‘F Y’); ?></a>
You could just do cosmetic changes on your theme with some javascript: <script type=”text/javascript”> jQuery(document).ready(function(){ jQuery(‘.tags li a’).prepend(‘#’); }); </script> <ul class=”tags”> <li><a href=”https://wordpress.stackexchange.com/tag/sometag/”>sometag</a></li> </ul>
wp e-commerce has a few shortcodes for displaying products, you may be able to use one of these: display products set as “featured”: [homepage_products] show a whole category: [wpsc_category=1] the products are stored as a custom post type named “wpsc-product”, so you could also just use all of the built in WordPress functions for querying … Read more