Tag Info

Hot answers tagged

12

is_front_page() returns true if the user is on the page or page of posts that is set to the front page on Settings->Reading->Front page displays So if you set about us as the front page then this conditional will only be true if showing the about us page. is_home() return true when on the posts list page, This is usually the page that shows the ...


3

Well first of all, if you set your page as the static front page, you don't need to associate the template with the page, and the template doesn't need a header. WordPress automatically uses the front-page.php template for a static front page, as per the template hierarchy. To answer your question though, you need to call the_post() first to set up the ...


3

wp_reset_query(); or consider saving your $wp_query result into $my_query = new WP_Query(); if( $my_query->have_posts(); etc. Just take a look at the codex page.


2

Your slider needs to be created from a second, custom Loop. There are a few options, including using $my_query = new WP_Query(), however, generally speaking, my preference is to use $my_query = get_posts(). If you post your slider code, we can help you customize it properly.


2

I achieved that using WP-Cron capabilities. add_action('wp', 'wpse_26170_activation'); function wpse_26170_activation() { if ( !wp_next_scheduled( 'wpse_26170_update_readme_page' ) ) { wp_schedule_event( current_time( 'timestamp' ), 'daily', 'wpse_26170_update_readme_page'); } } function wpse_26170_update_readme_page() { $page = array( ...


2

I want to make a static about page for my wordpress site. I don't like the format of the wordpress static pages that are managed through the control panel... But that's how the WordPress CMS is designed to be used. For static pages, create static pages. so I thought I would make my one custom page where I would have full control of the layout, ...


2

Weird Problem!, try the following: Make sure that the targeted categories are not empty. If you are using custom post type,include it in the query 'post_type'=>'advertisement' for example. If the targeted categories are special taxonomies,make sure to include it in the query : 'term'=>'cars' along with child 'cars'=>'toyota'. in this example and ...


2

You don't really have a Loop. <?php get_header(); ?> <div class="content"> <div class="welcome_area"> <div class="welcome_area_title"><?php the_title('');?></div> <div class="welcome_area_text"><?php if (have_posts()) { while (have_posts()) { the_post(); the_content(); } } ?> What is happening ...


2

Your question is quite unclear, that's probably why you are getting inconsistent answers. If you want Google not to follow you (or any search website), you could use, as recommend by WPMU-DEV Ari, "Search Engine Visibility" which can be found in the Settings -> Reading menu. However remember, search engines are not forced to listen and/or obey your request. ...


2

I was working with wp_cron last week in a plugin and we have a fight and are no longer on speaking terms, but for reference this is what I do; 1) - set the scheduled cron event on register_activation_hook 2) - remove the scheduled cron event on register_deactivation_hook If you are concerned that your scheduled cron event might get wiped from the database ...


2

You could add a rewrite rule to your theme that sends requests for page.html to the page itself. I'm not confident to supply code, but the rewrite documentation on this page is helpful. The last example there is the simplest illustration I've found of query rewriting. It helps to use ugly permalinks while you're arranging it as you get to see what requests ...


2

Is there any particular reason not to use the front-page.php template file, and just not bother with trying to pull WordPress headers into external files? Using the front-page.php template file is easy: Create a new static Page, with any arbitrary name (let's call it "Front Page") Go to Dashboard -> Settings -> Reading and set "Front Page Displays" ...


2

Maybe take a look inside the 2010 theme that comes packaged with WP, index.php shows a call to a loop file: <?php get_template_part( 'loop', 'index' ); ?> so you could (well this is how i would do it, cos i think it looks neater, but you could use multiple loops) create 2 new loop files for example they could be called loop-economy.php and ...


1

You could use wp_paginate_links(), pass it the 'type' => 'array' parameter in the argument array, and then array_reverse() the output. But: if you're doing this for SEO purposes, don't bother. Your canonical URL should be your single-post view, not an archive index; so the index archive page numbers should have minimal SEO impact, no matter what order ...


1

Try searching the WPORG Theme Repository for a Theme updated sometime since Fall 2010 or so. The Theme Review Guidelines require that Pages not display time-related content (such as Post Date/Time stamp), and that Pages not display "comments are closed" type messages on Pages with comments disabled. The Son of Blue Theme was last updated in May 2010, which ...


1

Ah - got it - was almost there with the new WP_Query, but was failing to call the query method on it... This works perfectly: <?php $excerptQuery = new WP_Query(); $excerptQuery->query('showposts=6'); ?> <?php if ( ...


1

So long as you have a standard page template header in your map-template.php, you can use the Custom Post Template plugin (which essentially allows you use templates on posts in the same way you do with pages). Update: Perhaps you might be better off using shortcode. For example; This is my post content in the editor. And here is a map; [my-map] And in ...


1

Not exactly, WordPress determines it's query from the URL structure, so: www.example.com/my-sub-page/ would be the exact same structure as www.example.com/my-other-top-level-page, so WordPress would have no way to tell if you are looking for a subpage or a top level page. Having said that, I don't think WordPress lets you have the same slug for a sub level ...


1

According to the following page Live Writer can manage pages as of Beta2. http://en.support.wordpress.com/xml-rpc/windows-live-writer/ Maybe it's simply a case of waiting to use the newer version that includes page management? I don't use WLW myself, but a quick google did garner the above link, so hope it helps.


1

The standard WP RewriteRules ignore files and directories that "exist". Example: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress This the rewrite rule set for ...


1

Put everything into WordPress. This way, you can search your entire content from the built-in search engine, and you can edit each piece. If you need pages with special markup create templates for your theme. Naked Template <?php /* * Template Name: Naked * * That’s the complete template! */ Basic HTML5 <?php /* * Template Name: Basic HTML5 ...


1

First there are a bigger difference between posts and pages and in your case it would be that posts have categories and pages don't. Anyway the simplest way to achieve what you described would be to create 4 categories, and use posts. use the same template for all categories but in your sidebar use category posts widget to list the posts from that ...


1

You said you wanted to create a "template" for each of the 4 categories. Creating a page template may be a little more technical than you're ready for if you're just getting started with wordpress, but that depends on your coding knowledge. How comfortable are you with HTML, CSS, & PHP? Also, if you're interested in creating real page templates to use ...


1

Create a file front-page.php as a copy your index.php. Add the slider code on top of the page. WordPress will now take care of the pagination for you. If you need the slider on the first page only wrap it into a conditional: // First page if ( empty ( $GLOBALS['paged'] ) or 1 == $GLOBALS['paged'] ) { // slider code } // the regular loop follows


1

I would recommend waiting until WordPress 3.4 is released. Among other features, it is slated to include the ability to allow Themes to define/declare a static front page. I believe this functionality should suit your needs. (Note: as of today, WordPress 3.4 just hit Beta 1, and is scheduled for final release in May.)


1

When you use "static front page" are you selecting the actual page you want displayed on the home page? It sounds like you want the "Splash" page as the home page. You should create the Splash page in the Page Edit Screen, select a custom page template if that is what you're wanting to use and save the page. Now you'll go to Reading>Front Page Displays ...


1

Richard To be honest I think you are asking How can I stop WordPress from responding to URL's for static pages that I save in other directories on my server Basically its in 2 files your VHOST (which maps mydomain.com to www/some_folder/ ) your .htaccess file which manages redirects So you can do 2 things ... 1. get a new VHOST for subdomain so ...


1

The core of Wordpress will not touch your .htaccess file outside the comments. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Plugins such as WP Super Cache might but I've never ...


1

You need to open up your custom child theme and add a loop to the index.php. Or if you want it in the sidebar then you add it to sidebar.php with a conditional check if you only want it to appear on the homepage. If you only want to show one post you add something like this. <?php global $wp_query; $args = array( 'cat' => #, //add the category ...


1

I'm assuming that you want to have a home page with it's own content and then the blog to be elsewhere on your site. What you want to do is create a Page Template. Call it Home Page Template or something like that and you can make the file whatever you'd like - maybe template-homepage.php. You may want to copy your page.php file and rename it, add in the ...



Only top voted, non community-wiki answers of a minimum length are eligible