Ed N.
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Creating Page Based on CategoryOk. So using the Flutter plugin, I am able to create a custom field for my clients to enter the category number. I am also able to create a custom write panel in which I have hidden custom fields (just for simplity sake) and named it “Category Page”.
In my page code, I have created a WP_query that pulls the cat number, and runs a loop based on that cat number. If the cat number is blank, it does nothing.
Example of use:
Lets say you run a website about cars. You have pages about Ford, Chevy and Dodge.So now you have a page for Ford cars. The content portion of the page has a quick summary about Ford, the types of cars, ect. However, as you write posts about Ford products, news, ect, this page will now begin to become much more dynamic.
In doing it this way, my client can have a “template” page for each category without having me create a hard coded descriptive section at the top… and I like that!
Anyway… this is what I am doing and why.
Forum: Themes and Templates
In reply to: cat=x string in post query causes frontpage to go blank!!I found this same problem, but have found an alternative that works!
As we have seen, using the following code does not work:
<?php query_posts('cat=1&showposts=2'); ?>
However, after a ton of google searching, I found an alternative that seems to work:
<?php $my_query = new WP_Query("cat=3&showposts=10"); while ($my_query->have_posts()) : $mt_query->the_post(); ?>
Continue the loop here…
Hope that helps!
EdForum: Themes and Templates
In reply to: Creating Page Based on CategoryMoshu,
The reason for this is simple. I am using WP as a CMS and want to allow my clients to create a new page that feeds off of articles in a selected category. Sure I could create a category-name.php file, but that requires me to manually set this up each time.My idea is that they have a page for “Dogs” and can add info into the WYSIWYG editor for that page that will populate the top of the page. However, below that will be the latest articles (posts) that relate to that category.
Actual application is for a real estate site. Lets say I have a “Local” page and under that category I allow my clients to add a new category for a city. I would want them to be able to create a page with the same title as the category that loads related articles yet still post the page’s post info so that they can give a general description of the city. Then any posts they make to that category would populate only on that city’s page below the page’s post data.
Does this make sense?
EdForum: Developing with WordPress
In reply to: Display Info if admin, otherwise hideAlexSherby,
I have yet to determine how to make this a plugin (I played with it for a few minutes, but the raw code won’t work as plug-in), however I have found a way to hide the areas I wanted gone…Here is the code:
<? // If user is less than admin, hides certain areas in Advanced Options get_currentuserinfo() ; global $user_level; if ($user_level > 9) {$hidefromuser=""; } else {$hidefromuser="display: none";} ?> <style> #pagecustomdiv, #pagetemplatediv, #postcustom, #trackbacksdiv, #revisionsdiv {<?php echo $hidefromuser; ?>;} </style>
I have placed this at the top of the following pages, and it simply hides the items I wanted hidden:
wp-admin\edit-form-advanced.php
wp-admin\edit-page-form.phpAs you are aware of, adding other sections to this is as simple as looking at the source code of the page and post admin sections for the DIV labels.
Hope that helps!
EdForum: Developing with WordPress
In reply to: Display Info if admin, otherwise hideAlexSherby,
I am seeking to do the same thing. Did you find something that worked? If so, would you share it?
Thanks,
Ed