admin

Website Tutorial

WordPress display the latest comment

WordPress display the latest comment <?php global $wpdb; $sql = “SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = ’1′ AND comment_type...
Website Tutorial

wordpress display random articles

<?php $rand_posts = get_posts(‘numberposts=10&orderby=rand’); foreach( $rand_posts as $post ) : ?> <li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li> <?php endforeach; ?>
Website Tutorial

WordPress-Change the blog name and description

In header.php, the following two lines of code are used to display the blog name and description: ~~~ <h1 id=”logo” class=”grid_4″>BBBBF</h1> <h2 class=”grid_12 caption clearfix”>Our <span>blog</span>, keeping you up-to-date on our latest news.</h2> ~~~ The above is static code, now...
Website Tutorial

WordPress theme-Change the stylesheet style.css path

WordPress theme-Change the stylesheet style.css path Before this, the homepage you saw was messy because the css style had not been loaded. Now let’s add the style together. You can find this code in header.php: `<link rel=”stylesheet” href=”./style.css” type=”text/css” media=”screen”...
Website Tutorial

WordPress theme-create header.php

WordPress theme-create header.php Next, create a new PHP file header.php in the theme directory wp-content\themes\bbbbf we created last time. We extract the header code in index.php and copy and paste it into header.php. The following code is all the code...
Website Tutorial

WordPress template main file composition

Theme file composition Before you start making a WordPress theme, you must first understand what files the WordPress theme is made of, and you must know how the WordPress program is connected to the theme file. The following are all...
Website Tutorial

WordPress functions.php-add CSS styles and JS scripts

Although our theme has a style.css file, it is not used yet. Let’s enqueue it now. Add the following code to functions.php, so that the styles added in style.css will be applied to the theme’s styles: function my_custom_theme_enqueue() {wp_enqueue_style( ‘my-custom-theme’,...
Email Marketing

Email Marketing-How to add Google Analytics to emails?

Adding Google Analytics tracking to emails involves a slightly different approach compared to tracking website visits. Here’s a step-by-step guide on how to add Google Analytics tracking to emails: Step 1: Get Your Google Analytics Tracking ID Sign in to...