saberj
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpOk, for some reason I was thinking I needed to echo that. Thanks a lot.
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpI’ve tried for the last two days to play with $pagematch, and can not get it to display anything. Not $pagematch->the_content(), not $pagematch->the_post(), not just $pagematch. I’ve been echoing all of those things, with or without applying filters, but nothing works. So I think you are going to havedumb it down a little more for me.
//do your page content display stuff hereI want to put the page display there, what goes there?
echo $pagematch->the_content();
OR
echo the_content();
OR
echo $pagematch->the_post();
OR
the_post();
I’m pretty sure I’ve tried all of those, without any success. Did I miss something and it is one of those? Or am I still missing something there?
You said you supplied the code to do this above, and that’s probably true, but I still haven’t seen how it’s actually supposed to be used.
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpI got the line breaks sorted out. But I still can’t find function that looks for a page by slug, rather than by name. Thanks again!
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpOk, that was the missing piece. I knew that the category was looking at the slug. But I had no idea that pages even had slugs, much less that it was looking for one. Sure enough, my screen options were hiding the page slugs. Once I gave that a change, it showed up.
However, I was wondering what the best function would be to grab the page contents. Currently I’m using:
$page = get_page_by_title($catname); echo apply_filters('the_content', $page->post_content);There are two problems with this function. First, it’s getting the page by the name, rather than by the slug. So I have to actually give the page name the same name as the slug in order for it to work.
Secondly, applying the filters seems a little inconsistent. Sometimes the line breaks work, sometimes they don’t. What would you suggest to pull the page contents?
Thanks again. It looks like I’m very close to getting it working as intended thanks to that help. It’s still a bit off due to the formatting. But at least it isn’t showing the episode player like it used to. See:
http://www.geekshow.us/newdev/category/content/podcasts/buffcast/
That is an example of some of the line breaks working. However, there should also be one after the image, and that’s being stripped for some reason. Compare to the actual page’s formatting: http://www.geekshow.us/newdev/buffcast/
Also:
http://www.geekshow.us/newdev/category/content/podcasts/angel-investigations/
That pretty much only has one line break working. The rest don’t work at all. Compare to the actual page’s formatting: http://www.geekshow.us/newdev/angel-investigations/
Thanks again. I think that about wraps everything up. 🙂
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpYeah, the page is named after the Slug, not the category itself. I echo’ed the $catname variable just to verify that it was checking for what I assumed it was checking for. But it still won’t come up with a match. But as I said, I can’t figure out where “pagename” is coming from in that case. Is it a built in function for WP_Query?
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpAha, a response! Thanks very much for taking the time to do this. Let me answer some questions first….
The first code you included was basically grabbing the name of the category, appending the word “Category”, and then looking for a page with that name. So basically, if you were looking at a Category named “Foo”, it would then look for a page titled “Foo Category”. If that page exists, it was supposed to dump it’s contents onto the screen, then continue listing the contents of the category.
You are correct in assuming I am using a category listing, and pulling the page content into that, not vice versa.
Now, the thing is, the code that you pasted from my current code isn’t in a category.php file. In fact, I don’t even have a category.php file. That all comes from archive.php, where is does all the work for Categories, tags, daily archives, monthly archives, etc.
SO…I used the code you gave me, and the problem I am having is this. It is always doing the stuff after the endwhile endif. Meaning, it’s never finding a match. I echo’ed the $catname, which gave me the category slug name as I assumed it would. However, I could never get it to match a page name of the same.
$pagematch = new WP_Query("pagename=$catname"); // if the Page name is the same as the category name..Is there any chance that the above code is wrong in some way? It’s never making the match. I have a category with a slug “test”, and it’s not matching the page named “test”. But when I echo the $catname, it is in fact returning “test” as the slug.
I don’t know anything about WP_Query, so I can’t make any suggestions as to what may be wrong. But obviously $catname is working as expected. The “pagename” part isn’t, though. Is that something that is a part of WP_Query? Or the DB? Or was that another parameter that was supposed to be set? Because I see nothing about it in the code you gave me.
I apologize for the includes and such. That’s the way the theme came when I got it. When I was shopping for theme designers, it looked like it would cost in the thousands rather than the area around $100 to a max of $200 I was looking for. So I had to go with what I could get. I like the theme, but I can’t speak for how well it is designed, since I know nothing beyond the little bits of code I can patch together. 🙂
Thanks again for your time and effort.
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpSorry, I should have pointed out that not all of the categories HAVE descriptions up. It’s on the to-do list, but I just haven’t gotten to it yet. Most of the entries in the Podcast list have descriptions, though.
The problem is that I’m working with a lot of stuff I can’t necessarily rely on. My coding is primitive at best. I learn by dissecting other bits of code from other places, and trying to recreate it. Or when the Codex/Reference list is helpful, I will learn from that.
However, I’m also using a premium theme called “Our Community”. It looks pretty well designed overall. But I have found an occasional mistake here or there. So I can’t rely on it being flawless.
Add in the fact that WordPress is no longer supported, and we never got a 2.6 patch, much less a 2.7 patch, and the situation becomes even more unreliable.
I can tell you this, as it may be more helpful. I’ve disabled EVERY plugin I have except for Podpress (since that’s obviously where the issue is rearing it’s ugly head), and it still happens. So at least we don’t necessarily have to worry about something else being the cause of the problem. It’s almost entirely isolated between the theme, my code alterations to the theme, and Podpress or it’s interactions with the_content.
So yeah, let me go ahead and pack up my theme files, and I’ll toss them your way.
I’m using WordPress 2.7 with Podpress 8.8 installed. I really appreciate the help, it’s a hard task self-teaching yourself to troubleshoot these sorts of problems.
Edit: Forgot a question you asked that may be important. No, I did not write my own filter. I was under the impression that if you applied the “the_content” filter, that it would apply all the formatting without needing to write your own.
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please Helphttp://www.geekshow.us/newdev is the development version of the website I am working with this problem on.
The reason I’m not jumping in on the idea of using the Category Description, is because it’s already being used. Currently, for the navigation bar, when you hover over an item, it will pop up the description and tell you what the category is about. If I start using the description area to store page content, then I either have to remove that, or deal with it listing a lot of content I don’t necessarily want to be displayed.
For the record, the the_content() is being called for in archive.php, which is the file that determines if it’s a category archive, tag archive, search, etc. Then it displays the information accordingly. In this case, I have it setup to display the page as with the the_content filters applied, and that’s what calls in the wrong content.
This is almost certainly a case of Podpress being out of date and not playing nice with the newer versions of WordPress. I say this not because I’m confident in my coding abilities (Because I’m not, at all). But because the plugin that does exactly what I need it to do (Page2Cat) has the same exact problem. So either we are making the same exact problem (Which is possible, since I know nothing about “Resetting a query”, and the plugin author may be making the same mistake), or the way the podpress player is placed in the post is causing issues.
Still, at least now I have a direction to go in to try and find a solution. I’m just not sure the description is the best way to go about it.
I’m also going to look into some of the themes out there that make WordPress into a CMS. I’ve always heard about how it could easily be themed that way, but it seems to be a whole lot of hoops to jump through if you don’t know what you are doing.
Thanks, doodlebee
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpOne last request, since I suck at regex. Can someone post an example preg_replace that takes “\\\” and replaces it with “
“?Everything is very appreciated. It’s nice to actually get pointed in the right direction. I still wonder why the_content() is pulling content from another section when I am working with pages. That would be the preferred and “pretty” fix. But this should work almost as well, if I can get it right.
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpIf I used a preg_replace, then my descriptions would suddenly have (For example) “\\\” randomly placed in it, correct? My theme already displays the Description in other places, so I think that it’d be quite a bit of work to remove the descriptions elsewhere. Could it be done in a similar way that doesn’t involve ruining the description for use elsewhere? Perhaps still using a page, rather than the description? Then just still using the preg_replace instead of formatting the HTML?
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpIt’s not a database query, if that’s what you are asking. It looks like this currently:
if (get_page_by_title($categoryname . " Category")) { ?> <div class="archives box"> <?php $page = get_page_by_title($categoryname . " Category"); echo apply_filters('the_content', $page->post_content); ?> </div> <?php } else { ?>The same thing pretty much happens if I change it from the echo apply filters to echo the_content(), best I remember.
The problem with just pulling the description, is that I’m not sure that solves the problem of accepting HTML, accepting pictures, etc. I’m willing to bet that the description also either strips the HTML, or doesn’t process it, one or the other.
So that’s definitely thinking on the right track, but I’m not sure that it would be any better for my purposes than a straight up “echo $page->post_content;”
Forum: Fixing WordPress
In reply to: Pulling My Hair Out with the_content – Please HelpThat’s not a stickied post. That’s the contents of a page. The problem is that the audio player (See the Play button, download links, etc) are all at the bottom of the “page”, rather than being in the first actual post, like it should be.
Now, I can’t go the route of the home.php, because I have no less than 11 different categories that will need a different setup that is still similar to what is on that page. Not just the one category, but 10 more as well.
Forum: Fixing WordPress
In reply to: Author can’t post youtube videos, but Admin/Editors can?http://ww.wp.xz.cn/support/topic/196977?replies=12
Author’s don’t have the permissions to embed flash. Read the above thread for the reasons why. If you feel confident with your authors, I would look into the Role Managers Plugin, which lets you change that setting.
Forum: Plugins
In reply to: [Plugin: podPress] Need Some Help – Player PlacementYeah, you misunderstood the question. The problem is not how to place it. The problem is what is causing it to get moved, once placed. Page2Cat seems to ignore that it’s part of a post, and moves it to the Page that is being viewed, rather than keeping it in the post…
Thanks for the help, though.
Forum: Plugins
In reply to: Problem With “Category Page” and “Podpress”Surely there is someone active in one of these two plugins that could help.