scribblerguy
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: query_posts – more resultsHave you checked out the Codex – The Loop. Look at the multiple loops section.
Use the query_posts() function to grab only the specific posts (e.g. limit the first loop to five posts, then in the second post, grab five more posts with an offset of five.)
On the homepage, it works fine. But, when viewing page 2, well, it’s a pain! Page 2 shows posts 10-15 in fulltext and posts 16-20 with only the title – see my problem? I can’t view the posts 6-10 in fulltext with posts 11-15 with only the titles..
Then you need to use conditional statements. Put the front page content inside an
if (is_front_page()) { ... }
statement. Then, put the format you want for page 2, 3, 4, etc. inside an else statement immediately after the if statement.The is_front_page() function is new to WP 2.5 . Right now, I’m still using
if (is_home() && !is_paged())
which seems to do the trick, so if the is_front_page() function doesn’t work out try the (is_home…) instead.If you aren’t familiar with conditional statements, then please look around the net for a basic PHP tutorial, or at least look at the Working Examples on the Codex page for Conditional Tags.
Forum: Fixing WordPress
In reply to: Can anyone help me with this? Static homepageYour
query_posts()
calls are overriding the default query, which would be the static page’s content.Take a look at the “Multiple Loops Example 2” section in “The Loop” (see link, below). There, the default, automatic query (which here, should be your static page content) is saved in a variable, then the query is called later.
Applying that example to your template, at the top of the file, put
<?php $temp_query = $wp_query; ?>
. Then, right after the<div class="contenthome">
, put<?php $wp_query = $temp_query; ?>
.In the alternative, you might be able to use
<?php rewind_posts(); ?>
before your third loop (right after the “contenthome” div. Or you might be able to use thequery_posts()
function to call a specific page — the page you’re using for the static home page.More info:
Codex – The Loop
Codex – Query Posts
Forum Topic: How to query posts after querying pages
Forum Topic: How to reset or rewind query_postsForum: Fixing WordPress
In reply to: Just summary of article on front pagePlease check out the Codex, particularly Tag Templates – Modifying How Posts are Displayed.
Most themes use the title to link to the permalink address for the article, so title = link shouldn’t be something you’ll need to worry about unless you’re creating your own theme.
Forum: Fixing WordPress
In reply to: Not foundI checked your site. The first time, the site loaded with posts. The second time, the theme loaded and in the content area, this appeared.
Not Found
Sorry, but you are looking for something that isn’t here.
If you search your theme’s “index.php” file, I think you’ll find the “Sorry, but you…” line at the bottom after an “else” statement.
So, it appears that your WP install is (1) connecting to your database properly; (2) loading the basic information [site address, name, theme]; (3) but not any posts or comments.
This is stretching my expertise, but here goes… I think that your WP database could be damaged.
First, backup your WP database: Backing Up Your Database and, if you can export your posts via the Admin interface, then do that, too.
Second, switch to a default theme. If the problem persists, then this isn’t a problem with your theme.
Third, try the instructions here – Repairing (WordPress) Database Tables. Then, empty your browser cache and try your site again.
If that doesn’t work, redo your WP install – new database and so forth. Then restore your database (instructions are linked in the backing up page I linked to earlier).
If you’re still having problems, then this could be a server issue.
Forum: Fixing WordPress
In reply to: Text Size – Making just a few words BIGGER than others in a postTo the OP, what are you trying to do? Add subheadings?
Are you using the visual editor? If so, click the last button on the far right, that will reveal another toolbar with a drop-down box of different formats along with more buttons. (Also, don’t abuse the
<h2>
,<h3>
, etc. tags. They are for heading not just making some text bigger.)BTW,
<font>
is deprecated. Using inline styles (e.g.<span style="font-size: 2em;">Bigger Font Size</span>
) is acceptable, though external stylesheets are preferred for flexibility.Forum: Fixing WordPress
In reply to: can i use php when writing a post or page?I want to use template tags on a page to show only posts from one category.
WordPress already does this for you. E.g.: “
www.your-blog-domain.com/category/your-category-name/
” only shows the posts in the “your-category-name” category. If you want a custom page for that category, you can create a category template page named “category-6.php” where “6” is the ID of the category you want. See the Template Hierarchy.If you really want a page instead of linking to the category archive, then instead of using PHP inside the content of a page, create a Page Template with the code you want. Then for the particular page, select that template in the Page Template drop-down box.
(Yes, there are plugins that will allow PHP inside a post or page, e.g. Exec-PHP, but, personally, that should be a last resort, especially when WP’s templating features can be used, instead.)
Also, how can I set up a back button so people can go through older posts?
See Codex: Blog Design and Layout — check out the “Next and Previous Links” page.
Forum: Fixing WordPress
In reply to: if a specific key exists, change the output in get_pagesForum: Plugins
In reply to: Word Press w/ File Management?Anyone know of some plug-ins?
See the Plugins Directory. Search for “download” or check out the plug-ins tagged with “download.”
Forum: Fixing WordPress
In reply to: No link to a previous/next post….Is this a “theme” issue?
Yes. If this is a custom theme, then there are several built-in WP functions for you to use. Look at Template Tags. The prev/next functions in the “Link tags” box is for archive-type pages. The prev/next functions in the “Post tags” box is for the “single.php” page.
You just changed your theme, didn’t you? Everything looks okay now.
Forum: Fixing WordPress
In reply to: Post Order..I want the newest post first.
That is the normal default order. But, there is a bug in a version of MySQL (5.0.51, I think) that is messing up the ordering of posts.
To check, create a new post and change the date to some day before your most recent post. If things are working correctly, this back-dated post should not appear first.
Then, temporarily switch to a default theme, if the order is still screwed up (back-dated post is first), then it is probably the MySQL bug. If the order is okay, then your theme’s file has been messed up. Replace your theme’s index.php file with a fresh copy.
Forum: Fixing WordPress
In reply to: can’t post commentYour blog is at “https://www.hirol.com/wordpress/”, but the links are based at “https://www.hirol.com/”.
See Giving WordPress Its Own Directory. Follow the instructions there. That should fix the problem.
Use conditional tags. If you’re not familiar with PHP conditional statements, “The “Variable Sidebar Content” example on that page should get you started.
Forum: Fixing WordPress
In reply to: show only first paragraphYou can manually add text to the excerpt field on the “Write Post” page when you create a new post (or edit an existing post). Copy the first paragraph from your post and drop it into the excerpt field. Though, you’ll have to add formatting such as
<strong>
and<em>
.See the Codex page: the_excerpt for more information.
Forum: Fixing WordPress
In reply to: Error establishing a database connectionIf you have back-ups of the databases, follow the instructions here: Restoring Your Database From Backup.
If you exported the contents of your sites using WordPress, follow the instructions here: Importing Contents.
If you don’t have any back-ups, see if your webhost has a back-up of their MySQL server. They might be able to restore the DB’s for you. (There might be a fee involved.)
If you don’t have any back-ups and your web host is unable to help, then you will likely have to start over. So, good luck.
Forum: Fixing WordPress
In reply to: Check for the existence of a custom fieldif (post_custom('my_custom_field_name')) { ... }
is another way to check.