Hello All..
I need help with wordpress,
I have figured out how to show certian posts with category in a page..
but the page numbers are not working and i cant figure out why.
Here is the code to query and show categories in california -
<?php query_posts('category_name=california'); ?>
-
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
-
for some reason the page numbers at the bottom are not working.. does anyone know what code i need to add?
here is the page code, next and prev - <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
thank you!
5 3450 dlite922 1,584
Recognized Expert Top Contributor
Most likely you changed one variable somewhere to increase the num per page (probably hard coded it) and forgot to change it else where (where it still expects a variable, that may now be undefined for example).
I don't know the WordPress code by memory to help you locate it.
My advice: What code you posted is barely enough to cover your question. Try to understand what the code does, trace it, and find the problem.
Good luck,
Dan
Hello Dan!
here is the full code.. - <?php
-
/*
-
Template Name: page_states
-
*/
-
?>
-
-
<?php get_header(); ?>
-
-
<div id="main">
-
-
<div id="contentwrapper">
-
-
<?php
-
global $more;
-
$more = 0;
-
?>
-
-
<?php query_posts('category_name=california'); ?>
-
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
-
-
-
<div class="topPost">
-
<?php edit_post_link('Edit', ' | ', ''); ?></span></p>
-
<h2 class="topTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
-
<p class="topMeta">Location » <?php the_category(', '); ?>
-
<div class="topContent"><?php the_content('(More Info...)'); ?></div>
-
-
<div class="cleared"></div>
-
</div> <!-- Closes topPost --><br/>
-
-
-
<?php endwhile; ?>
-
<?php endif; ?>
-
-
-
<div class="navigation">
-
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
-
</div><!-- Closes navigation-->
-
-
-
<div class="cleared"></div>
-
-
</div> <!-- Closes contentwrapper-->
-
-
<?php get_sidebar(); ?>
-
-
<div class="cleared"></div>
-
</div><!-- Closes Main -->
-
-
<div class="cleared"></div>
-
<?php get_footer(); ?>
-
dlite922 1,584
Recognized Expert Top Contributor
No, I don't think you know how programming works. This is not the full code.
The full code is multiple files probably, and I can't go through it for you to find your problem. (Unless you pay me ;) )
My original point was for you to "Try to understand what the code does, trace it, and find the problem " yourself.
If you don't know how a particular thing works, you have the manual at php.net to look up particular php function or otherwise ask us what a piece of code does, not the entire program.
WordPress is an open source app. I'm sure they have help forums where you can get help. Those guys probably will know the entire code more than us.
Good luck,
Dan
Its practically impossible to trace the error in a small code snippet that actually has roots & branches in multiple files.
My advice is refer this for wordpress problems: http://codex.wordpress.org/Main_Page
and search for the exact solution.
Sorry couldnt help much about it.
Hello All!!
FOUND IT!!!
Here is the solution for Pagenation in Wordpress using a page template querying one category.!!! Enjoy! this was a HARD Find... Hope it helps someone
<?php if(have_posts() ) : ?>
<?php $paged = (get_query_var( 'paged')) ? get_query_var(' paged') : 1;
query_posts("ca tegory_name=Cat egoryName&paged =$paged"); ?>
<?php while(have_post s()) : the_post(); ?>
In Christ,
Matt
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Michele Ferretti |
last post by:
http://www.blackbirdblog.it/programmazione/progetti/28
--
Michele Ferretti
ICQ#: 14491159
Skype: m.ferretti79
black DOT bird AT tiscali DOT it
www.blackbirdblog.it
|
by: surfivor |
last post by:
I am doing some preliminary research as we are slated to do a project
with wordpress. I looked at the wordpress code and realized why I like
MVC so much (Rails) because the code mixed in with the rendering
looked like a mess to me. I'm not at all sure exactly what we will be
doing on the project as the details haven''t been discussed yet.
I found that the Wordpress API doesn't look well documented. I set up
wordress and created some blog...
|
by: Ken |
last post by:
Hi. I've recently organized and even color-coded many of my favorite
bookmarks on WEB DEVELOPMENT (and a few other favorite subjects too)
into what I call QUICK LINK PAGES. These are very condensed, compact
(no graphics), fast-loading pages with a 100+ links to some of my
favorite web sites on a particular subject. I hope you'll give them a
try...
Here's the link...
http://www.winograd.com/QLP
|
by: nomad |
last post by:
An employee that was working on the project left, I got the task to rework some blog pages in WordPress. I have some exp. working with WordPress and PHP. but I hve no ideal how to do the following:
I do... I place a blog in an exist blog page. ie this blog page is simular to an HTML page but has NO place where people can write their thoughts about it.
An example would be nice, or if you can give me a link where I can do this that would be...
|
by: Nooze Goy |
last post by:
I'm trying to use a blog client to write messages with "attached" .pdf
content to WordPress blogs. WIth the "Direct Upload" mechanism, the
attached files work for some types (like .txt) but fails with .pdfs,
with a message about an XML parsing error. However, the XML code looks
pretty good to my untrained eye, and gives no errors when run through
some verifiers , and there are no errors in the httpd logs. As far as I
can tell, this is...
| |
by: Spondishy |
last post by:
Hi,
I've been digging around the web but haven't found a really good
example of how to create a new post in a wordpress blog.
I've found metaWeblog.newPost discussed in a few places, but I'd like
more info (or a working example if possible). Especially with posting
into specific categories.
Thanks in advance.
|
by: karen987 |
last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The first part is in the inc.header.asp file which is called up on every page. The page itself has the meta tag variable, ie. title, description. They work fine on all pages, except the one below i'm having problems with. Ironically it's the most...
|
by: maya |
last post by:
hi expert php'ers.....;)
is it ok to ask WordPress questions here? I mean if you don't get a
response to your quetion in WP forums where else can you go??
I have WP 2.3 installed on my own hosting server..
I'm tying to do something that should be quite simple yet I can't get it
to work...
I want to do my own form, w/o having to use a plugin.. I tried a contact
plugin, but you can't specify what address to send email to, which
|
by: sleepy1038 |
last post by:
Hello,
I'm developing a site that makes use of wordpress. The homepage is
outside of wordpress and I am pulling the latest 3 blog posts from the
wordpress database to display on the homepage. The problem is that
special characters (—) for example, do not display properly. It
displays as a "?" with a diamond around it �. The characters actually
display fine withing the wordpress blog portion of the site.
I tried changing the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |