Including 2 Negative Is_Template Conditionals in header.php [closed]

(Expanding on Pieter’s comment above, and explaining the logic behind it…) if() evaluates the conditions in the parentheses, and that evaluation results in either TRUE or FALSE for the sum total (which can change, depending on how the various conditions are combined). In plain English, if( !is_singular(‘device’) || !is_front_page() ) means, “If it’s either true … Read more

Templates to use multiple time within page? [closed]

If you are trying to do this within a page or post, you could make a shortcode out of it. [movie-template title=”Gone With the Wind” date=”1939″ image=”gwtw.jpg”] [movie-template title=”Citizen Kane” date=”1941″ image=”ck.jpg”] [movie-template title=”Star Wars” date=”1977″ image=”sw.jpg”] Then you need a little code, in your template’s functions.php, or in a custom plugin: add_shortcode( ‘movie-template’, ‘my_movie_listings’ … Read more

Custom Post Type Trouble

you likely need to do a flush re-write. go to settings/permalinks in the dashboard and click save. You’ll be good to go. In the future you can add this directly to your CPT plugin. I would suggest getting a bit more creative with your naming though so you don’t have conflicts later.

Output fields manually in Woocommerce email templates

Probably the easiest way is to manually construct a new Billing address format by creating a copy of the WooCommerce email address template in /your-theme-driectory/woocommerce/emails/email-addresses.php by replacing the original echo $order->get_formatted_billing_address(); with for example: $output=”<strong>Customer Name: </strong>”.get_post_meta($order->id, ‘_billing_first_name’, true).'<br>’; $output .= ‘<strong>Customer Last Name: </strong>’.get_post_meta($order->id, ‘_billing_last_name’, true).'<br>’; $output .= ‘<strong>Company Name: </strong>’.get_post_meta($order->id, ‘_billing_company’, true).'<br>’; $output … Read more

Implement HEAD and TITLE tags with DB DATA

What data are you looking to put in the tags? I’m just trying to understand if it’s data that WordPress may already make available. This seems to be the right way to get to data in the WordPress database: https://codex.wordpress.org/Class_Reference/wpdb Once you have the data, you can use wp_head to get the values in the … Read more

Force template on page load

This question is quite difficult to understand. Do you mean you want to make generic template pages Programmatically? There are a few ways to do this. If you have a page built on the backend, you can create a file within your theme folder called page-{page-name}.php. For instance, for a page called about, you should … Read more

Read more button not working

From the Codex: Excerpts (teasers) can be shown on WordPress through two methods: The first, keeping the the_content() template tag and inserting a quicktag called more at your desired “cut-off” point when editing the post. The second, by replacing the the_content() template tag with the_excerpt(). If one of those conditions is met, and you are … Read more

Make default template two columns?

1. Add .php in wp-content/themes/ Write <?php /** * Template Name: <subpage-name>, left sidebar * Description: A one-colum template with left sidebar for <subpage-name> ONLY */ get_header(); ?> 2. Copy full-width page basic codes. 3. Add new div for <div id=”main” class=”<subpage-name>-right clearfix” role=”main”> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( ‘content’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)