Jump to content


Photo
- - - - -
Resolved

Comments On Front Page And Hidden



  • Please log in to reply
23 replies to this topic

#1 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 15 November 2012 - 04:48 AM

Hi. I am running Pagelines 2.3.5 and am having issues with 2 comment related items.

1. Getting comments to "hide" then when the user clicks on the link it appears
2. Getting comments attached to posts on the front page.

For #1, I am using the WordPress ajax comments inline plugin. The instructions here

Please Login or Register to see this Hidden Content

say to put the below code into the loop. I have placed it at the end of comments.php, removing the last 2 divs at the end and replacing it with the below.

Please Login or Register to see this Hidden Content


The issue I have now is that the plugin functions as it should, but I now have 2 comment boxes. One is the hidden one, and one is the visible WP comment box. I dont know how to disable one and keep the other.

For #2, this has been a real trick. I have looked at other forums that say to put

Please Login or Register to see this Hidden Content


in the index.php file. Perhaps I just dont know where to put it in Pagelines. I have tried a few different places like comment.php to no avail. I tried to do a hook in function.php with the "pagelines_loop_after_post_content" hook, but to be honest, I am sure I flubbed it up. I dont understand hooks that well and the documentation is slim.

I am sure its an obvious fix but I just cant see it.

#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15788 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 15 November 2012 - 08:05 AM

HI,

That plugin hasn't been updated in over a year, I recommend you contact the developer for assistance to make sure its still supported and works with the latest version of Wordpress. Also, PageLines doesn't have the structure of a usual Wordpress theme. If you were were to implement this plugin, you would most likely need to use both hooks and filters.

We do not recommend editing the core files, as when an update is released, your code edits will be overwritten.

#3 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 15 November 2012 - 03:30 PM

Thanks Danny,

I went ahead and installed the Base Child theme. I can find a new plugin to do the drop down comment, so lets forget about that part for a second. How about getting the comments to appear on the front page? What hooks/filters do I need to implement with the Child Theme to make this work?

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 15 November 2012 - 03:57 PM

If your front page is a static regular page, you should be able to activate the Comments section in Drag & Drop in Template 1 (or Template 2 or 3 - whichever one) and set that Template 1 as the template for your front page in the page editor.

#5 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 15 November 2012 - 04:28 PM

Thanks Catrina,

I have tried this to no avail. Here was my process:
  • Modify a template to contain the POST LOOP, COMMENTS, and PAGINATION.
  • Create a PAGE with no content, assigned the newly created TEMPLATE, ensured that everything is ON that should be
  • Assigned the Front Page to a Static Page
Here is where is goes wrong. If I assign it to a Front Page: "newly created page", the content is now Totally blank. Firebug shows me I get all the header information but the body is completely empty. If I use Posts Page: "newly created page", I get the correct post loop but no comments. On the status bar, I see it has overwritten the template I chose and uses Template: BLOG, which has no comment option.

#6 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 20 November 2012 - 05:46 PM

Any other thoughts on this? Does anyone know how to use hooks and filters to get comments on the front page with Pagelines?

#7 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 20 November 2012 - 06:12 PM

When setting up your static homepage, does the Comments section work? Are you activating it Content Area?

#8 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 20 November 2012 - 07:30 PM

If the static homepage is set up as the FRONT PAGE option, then I get comments but no posts. When I do it as the POSTS PAGES option then I get the posts but no comments.

When using the Front Page option, setting it to the page I created for a static page, it shows the template I chose in the status bar. Content and Post Loop are enabled in the template but do not show on the page.

When setting it as a posts page, it does not set to the template I specified in the PAGE setup. It defaults to the BLOG template. In the BLOG template in the Drag and Drop part of Pagelines, there is no option to drag and drop comments into the template.

I would be happy to PM you the login details to take a look. I am pretty sold on Pagelines and am using it in at least 5 sites. I am hoping I dont have to move away from it in order to get this to work.

#9 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 21 November 2012 - 04:04 AM

Hi there,

I've found the below links which might be able to help you somewhere, but I'm not sure how'd you'd implement them into the child theme using a hook. The list of Pagelines Hooks are here,

Please Login or Register to see this Hidden Content

if you know the php of what you're editing then you might be able to work the info below into the hook, but as we're not trained coders we wouldn't be able to advise on the process.

If no one else comes forward with a response you might need to speak to a Pl Pro who can script this in for you somewhere, if you need to you can check them out at www.pagelines.com/pros/

Please Login or Register to see this Hidden Content


Please Login or Register to see this Hidden Content



#10 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 21 November 2012 - 07:06 AM

Thanks James. I've seen those links. If I'm not mistaken, those would require changes to the core Pagelines code, thus making it unupgradeable. I've gone through the list of hooks and found what I think I need. I just don't know how to implement it. I mentioned the hook in the first post, I guess I will see if someone can help with the code. It should not be difficult. An "add action" followed by a function encoding the php to show the comment on all posts should do it. Just need a little assistance there.

#11 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 21 November 2012 - 03:22 PM

If you're using a child/base theme, you wouldn't be editing the core files. Please see this documentation on the base theme:

Please Login or Register to see this Hidden Content



#12 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 21 November 2012 - 04:25 PM

Hi Catrina,

The posts that James referred to require editing the post loop and/or the WordPress index.php file. It looks like the part of the loop that needs to be edited resides in the class.posts.php which is a part of the core files, not an editable section. Maybe I am wrong here. The section for the postloop does not allow me to edit parts of the loop, just functions around the calling of the loop as far as I can tell.

Which brings me back to some kind of hook. Is anyone on the forum experienced with hooks?

It looks like I should be doing something like:

Please Login or Register to see this Hidden Content


But when I add code to the function.php, the whole site goes blank and only the header loads.

#13 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 21 November 2012 - 10:25 PM

Depending on the commenting plugin you use, some have a widget to display recent comments. For example, I use Disqus and there's a Disqus Widget for just the purpose you seek.

You may want to consider using a FaceBook or Twitter integration for comments, either of which have tons of available plugins/widgets to display recent comment postings. Also, you'd get the added benefit of those comments being posted to your FB or Twitter account helping to drive more traffic to your site.

#14 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 23 November 2012 - 07:13 PM

Thanks Rob. That doesnt really help much. I am aware of widgets and options. What I need is basic commenting functionality on the front page. This should be a very simple task but has proven to be elusive. I may have to go to another theme system for this one site. I'm surprised no one else has needed this functionality.

Would upgrading my account to Developer or Plus help get this issue resolved? Would there be additional people who could help if I updated and submitted a ticket?

#15 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 23 November 2012 - 07:17 PM

I don't think upgrading would make a difference - the issue would still be the same. Have you accomplished something like this (on a posts page) on a WP site before?

#16 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 23 November 2012 - 08:36 PM

I just meant would upgrading give me access to developers who can help out. When I use the Twenty Eleven theme, this works exactly as I want (see image below). Comments are added to every post on the front page. There is a "Leave a Reply" link that drops an AJAX Comments section. This is the JetPack comments plugin. It does not work on PageLines as described above.

Posted Image

#17 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 24 November 2012 - 05:22 AM

Hi again, no unfortunately you wouldn't get to deal with the developer team if you upgraded to dev/plus edition.

The only way would be to hire a pl pro, or check Odesk to see if any developers post for private scripting jobs, or if you're interested in creating products/themes for the store look into joining the junto group

Please Login or Register to see this Hidden Content



Again, I'm not a coder but looking at your code above it looks as if the php isn't closed off correctly, I don't think the last closing bracket } is required.

#18 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 25 November 2012 - 11:00 PM

Yeah, that was just my stab at it. Even removing the closing bracket and placing the code in the functions.php in the child theme breaks the site. I have to FTP back in, and revert the functions.php back to the non-modified state.

#19 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 November 2012 - 11:56 PM

Please forgive my misunderstanding. It seems you want the comment form to appear on the homepage under each post. Is this correct?

If so, we have to look to WordPress, which actually controls the comment form for the most part. It is incredibly uncommon for the comment form to be on the homepage as it's not considered attractive or useful there.

I did find this post on WordPress.org:

Please Login or Register to see this Hidden Content



The method to implement that two year old code would be to use the Action Map plugin we provide to identify the location of where you want the form to appear. Presumably below each post listed.

Shortly, we'll have a fantastic new hooks plugin that allows you to drop the code into a form and it writes the code for you. But if you can't wait a few days, once you know the proper hook, you can craft it using the PageLines Customize plugin which has a functions.php that you should use for editing.

Properly placing it in the correct hook, should, in theory, make the code provided in that link work.

#20 ajswanson

ajswanson

    Member

  • Members
  • 17 posts
  • LocationPismo Beach, CA
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 26 November 2012 - 01:26 AM

Hi Rob,

You are correct, we are looking to get comments on the front page under each post. Using the WP default themes, it is very easy to do. In the image above, you can see it functioning how we want it to. It has a link to "Leave a reply" which then activates the AJAX commenting form. So it is hidden unless needed. And if there are existing comments, it says "View replies" and upon click, the commenting structure drops down. We are trying to get this same functionality with Pagelines.

We have tried to do this through hooks. But it seems that any change to the functions.php results in a crashed site. I am not a very accomplished coder, so I am a bit blind here but we identified "pagelines_loop_after_post_content" as the hook to use. We then tried to call the very function you referenced. This is in an earlier post. But to recap, we placed:

Please Login or Register to see this Hidden Content


...in the functions.php of the child theme. This caused a crash. We then removed the last closing mark and still had a crash (crash meaning, the site went blank as well as the backend and we had to FTP in and revert the functions.php to bring it back). This code was our stab in the dark as I'm not a coder.

UPDATE: I tried the same thing with the Customize plugin. I went back the the pagelines parent theme. The Customize plugin is active. When I use the EDIT to change the code, the css file states it is (active) at the top of the screen but the functions.pho states (inactive). It looks like a better code option would be:

Please Login or Register to see this Hidden Content



But how do I make the functions.php in the Customize plugin active. The other two files (pagelines-customize/style.css and pagelines-customize/pagelines-customize.php) report ACTIVE but the pagelines-customize/functions.php file reports INACTIVE.





Also tagged with one or more of these keywords: Resolved