Ask your WordPress questions! Pay money and get answers fast! (more info)

How do I create a SINGLE TOPIC page? WordPress

  • SOLVED

Wordpress v3.5
OptimizePress Theme (child)
Plugins: WishList Member v2.71
========================================

What I'm looking for I believe is simple, but I am going to use plenty of words to make sure the question is completely understood.

------------------------------

When I create a PAGE using one of my theme pages such as MEMBER 1 CONTENT or MEMBER 1 NO SIDEBAR, I would like to make it do the following:

1. Members can post messages onto the page that contain text and can contain pictures and/or PDF attachments. Therefore it needs an editor box.

2. Each message contains the date/time and userid of the poster.

3. Each message appears at top, pushing older messages down the page.


My intention is that if I have a SINGLE TOPIC that I wish to have discussed, say "STOCKS", I want to simply be able to create a new PAGE and call it "Stock Discussions" or whatever. When the member arrives on this page he/she can post a message that appears at the top. After x number of messages, the oldest one drops off (or archives).

PLEASE NOTE:

I simply want to be able to create a new page that allows posting of messages and if desired, graphics and attached files (ie. PDF, etc.).

It can look something like this wpquestion page, where each person's message is listed with userid and date/time posted.

Each new message appears at TOP pushing older ones down.

I'm assuming this will require making a copy of one of my template pages and tweaking the code.

I just need to know code to add/tweak.

:)



Answers (2)

2012-12-17

Kyle answers:

1. Since you are using BBpress have you looked into using [[LINK href="http://wordpress.org/extend/plugins/gd-bbpress-attachments/"]]GD bbpress attachments[[/LINK]] for the attachments capability? That should be able to accomplish that.

Number 3 is more about sorting criteria, but probably need some context for how they are being used. An overarching type of function you can do is a query->set function that will check if a page template is being used, to automatically add variables, which in your case is sort by ascending, set the post count to 10 and no pagination when using a certain template

So (this is untested since I don't use bbpress)...

add_action( 'pre_get_posts', 'show_posts_for_user' );
function show_posts_for_user( $query ) {
if ( is_page_template('MEMBER_1_NO_SIDEBAR') ) {
$query->set('order', 'ASC');
$query->set('posts_per_age', '10');
}
return $query;
}



That is useful for make large changes across many queries, so for your case of trying to sort queries on many different pages you can sort them all the same way with something like that.

For #2 you just need to alter your template to output the right information for each query, you can use get_the_author to get the ID and any informaiton on the author, and something like this would spit out the post date for each

$the_post = get_post($post_ID);
$dateline = $the_post->post_date;

It is just about setting up the output of the query, you can set that to anything


rixtertrader comments:

I have bbPress plugin, but it is not setup. I don't know much about it.

What I am asking for does not necessarily require bbPress unless one of the pros here says "it does". Otherwise, I'd rather not use it.

Again, what I am looking for is to simply create a PAGE (one of my OptimizePress WishList Member pages, preferrably the MEMBER 1 NOSIDEBAR page as it is the widest) and be able to make it a DISCUSSION page.

bbPress is a FORUM plugin. It allows creating topics and all kinds of forum stuff. That is overkill for me.

Let me put it this way.

I would like my PAGE to do something like THIS page is doing that we are communicating on here at wpquestions, except each new message goes on top and you can add graphics or a PDF attachment link to it.

If it requires bbPress, I would need then to know HOW. If it does not require, good.

I'm thinking the answer lies in making a copy of the template page (MEMBERS 1 NOSIDEBAR) and adding/tweaking some php code in it. So what I need is the code/instructions on how to do this.

Thanks.


Kyle comments:

Gotcha, yeah I am not a big fan of any forum plugin out there either and if you don't absolutely need it then there are plenty of better choices.

Everything you are asking for is definitely possible and yes the changes would need to be made to the template. What you need to do is paste the entire code from the template so it can be edited how you want. ( I recommend doing it on pastie.org because I absolutely hate copying/pasting code from this site )


rixtertrader comments:

That's good to hear.

Would you happen to know what code I need to add to my copy page to make it do what I'm looking for?

:-)


rixtertrader comments:

Oh wait. I get what you are asking.

You want me to paste a copy of the template on pastie.org so that you can tweak the code.

LOL! I thought I was going to make the changes.

Okay, will post in a minute. Thanks.


Kyle comments:

That's what I meant by paste it to be edited haha. If you paste it to see I could tell you


rixtertrader comments:

Here's a link to the paste.

<script src='http://pastie.org/5549624.js'>
</script>

Didn't find any other type of link to provide so I hope this does it.

:)


rixtertrader comments:

http://pastie.org/5549624


Kyle comments:

Hm this is shaping up to be a bigger dilemma. Can you find and paste a file called wp-comments.php from your theme to view/edit that is where the code your theme uses to spit out the comments

Do you have the ability to turn the Facebook commenting function on/off?


rixtertrader comments:

No worries. I'll sweetin the pot if it works. :-)

That file must be a standard WP file.

I only found wp-comments-post.php, not wp-comments.php.

It may be what is referenced by comments_template() in the code.
<?php comments_template(); // Get wp-comments.php template ?>

Here's the paste:

http://pastie.org/5550382








rixtertrader comments:

And here is the code for comments.php which resides in my theme's folder.

http://pastie.org/5550418


Kyle comments:

Okay we are getting there haha :)

Inside that comments.php file you can see the call to wp_list_comments, which is the actual call in your posts to list comments. Apparently they are already being modified by a function called optimizepress_comment - see if you can find that in your functions.php file and paste it.


rixtertrader comments:

Better yet, here is the paste of the functions.php file itself.

Best you be able to find what you're looking for as I would not have a clue.

http://pastie.org/5554643


Kyle comments:

Okay, I think we have enough info now

I'll look through this and post a possible solution

2012-12-18

Arnav Joy answers:

I think you can use following plugin to enable image uploading , you can display all posts to that page and then enable comments for them and using this plugin images can be uploaded

http://wordpress.org/extend/plugins/comment-images/