Khairil Zhafri
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Style latest postHonestly, I am not so familiar with the
($postclass = ($post == $posts[0]))
bit. I have tried to use it but it made the following lines so complicated.You can still use what I suggest.
<?php if (have_posts()) : ?> <?php query_posts("showposts=1"); // show one latest post only ?> <?php while (have_posts()) : the_post(); ?> <div class="entry-head firstpost"> LATEST POST: <!-- all the usual template tags here i.e. title, excerpts, date, etc. --> </div> <?php endwhile; ?> <?php query_posts("showposts=4&offset=1"); // show 4 latests posts excluding the latest ?> <?php while (have_posts()) : the_post(); ?> <div class="entry-head"> <!-- all the usual template tags here i.e. title, excerpts, date, etc. --> </div> <?php endwhile; ?> <?php else: ?> <!-- Error message when no post published --> <?php endif; ?>
It may be a bit longer since you repeat most of the template tags twice but it works.
Forum: Fixing WordPress
In reply to: Add-On Domain without copying the whole blog to new folderOh, forgot to mention. I use domain pointers. Set new.net to point at main.com.
Forum: Fixing WordPress
In reply to: Add-On Domain without copying the whole blog to new folderI have thought of a similar idea. Then I tried to add the following in wp-config.php and it works.
$hostname = $_SERVER['SERVER_NAME']; $hostname = str_replace('www.', '', $hostname); if ($hostname == 'new.net') { define('WP_SITEURL', 'https://new.net'); define('WP_HOME', 'https://new.net'); }
Forum: Themes and Templates
In reply to: Style latest postWhat exactly you are trying to do?
Is it something like this? Then, I’ve offered a solution.
Forum: Installing WordPress
In reply to: Installing without domain? Advice Needed.Just instal on a subdomain. This is what I usually do:
My main site is: https://www.mainsite.com
Thenk I have an idea of a new project using WP, so I install it at:
thenewproject.com.mainsite.com
sometimes i have too many such ideas, i do like this:
thenewproject.com.1.mainsite.com
theotherproject.net.1.mainsite.com
thenewproject.com.2.mainsite.com
theotherproject.net.2.mainsite.commy hosting allowed multiple domains, so I just add the projects as new domains. you can still use subdomains.
Forum: Themes and Templates
In reply to: How to style latest post AND recent posts differently?I was trying to do something similar and discovered something pretty simple. You may try the following:
<?php if (have_posts()) : ?> <?php query_posts("showposts=1"); // show one latest post only ?> <?php while (have_posts()) : the_post(); ?> <!-- the latest post here --> <?php endwhile; ?> <?php query_posts("showposts=4&offset=1"); // show 4 latests posts excluding the latest ?> <?php while (have_posts()) : the_post(); ?> <!-- the subsequent posts here --> <?php endwhile; ?> <?php else: ?> <!-- Error message when no post published --> <?php endif; ?>
Hope it helps. ??