Jump to content
ajswanson

Comments On Front Page And Hidden

Recommended Posts

ajswanson    0
ajswanson

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 http://farlee.info/a...ine-plugin.html 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.


<?php show_hide_comments_link(); ?>

	 </div><!-- .entry-utility -->

<?php display_ajax_comments(); ?>

</div><!-- #post-## -->

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

<?php comments_template(); ?>

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.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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?

Share this post


Link to post
Share on other sites
catrina    103
catrina

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.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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.

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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

Share this post


Link to post
Share on other sites
catrina    103
catrina

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


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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.

Share this post


Link to post
Share on other sites
James B    436
James B

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, http://api.pagelines.com/hooks 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/

http://wordpress.org/support/topic/show-comments-on-home-page-posts

http://wordpress.org/support/topic/twentyten-add-comments-form-to-posts-on-the-index-page


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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.

Share this post


Link to post
Share on other sites
catrina    103
catrina

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


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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:


add_action('pagelines_loop_after_post_content', 'frontpage_comments');

function frontpage_comments() {

<?php

$withcomments = 1; // force comments form and comments to show on front page

comments_template();

?>

}

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

Share this post


Link to post
Share on other sites
Rob    547
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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?

Share this post


Link to post
Share on other sites
catrina    103
catrina

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?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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.

oo_screen_twenty_eleven.png

Share this post


Link to post
Share on other sites
James B    436
James B

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 http://developer.pagelines.com/apply/

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.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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.

Share this post


Link to post
Share on other sites
Rob    547
Rob

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:

http://wordpress.org/support/topic/show-comments-on-home-page-posts

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

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:


add_action('pagelines_loop_after_post_content', 'frontpage_comments');

function frontpage_comments() {

<?php

$withcomments = 1; // force comments form and comments to show on front page

comments_template();

?>

}

...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:

add_action('pagelines_loop_after_post_content', 'frontpage_comments');

function frontpage_comments() {

$withcomments = 1;

comments_template();

}

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.

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

UPDATE: Using the following code, I am able to get it to display if there are Comment or not with the Customize plugin. So the hook is in the right place. We're close folks!


add_action('pagelines_loop_after_post_content', 'frontpage_comments');

function frontpage_comments() {

comments_popup_link('No Comments', '1 Comment', '% Comments');

}

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi AJ,

Is this issue now resolved ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
ajswanson    0
ajswanson

We can mark it as resolved. Hopefully it will help others too.

Share this post


Link to post
Share on other sites
James B    436
James B

The topic was marked as resolved.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • janpeeters
      By janpeeters+
      Over the last month I had extensive communications with the developer of the (premium) Anything Boxes section (in Pagelines store) (Adam Munns) and the developer of the WP Polylang Multilingual plugin (Frederic Demarle).
       
      This was because the following problem occurred:
      Anything Boxes showed all posts of two languages (Dutch and English) on the respective static frontpages for each language. It should of course have filtered posts for Dutch language on the Dutch frontpage and English on the English frontpage.
       
      The solution to this problem was simple in the end. When duplicating a page for use in another language the settings for Anything Boxes were not copied to the new page and I should have set these settings manually again on the new page. I wasn't aware of this, but it makes sense. Because of this the pages didn't know how to differentiate between posts from different languages.
       
      The dev of Polylang told me that Polylang is currently smart enough to synchronize metas like Featured images and page templates but it does not work out of the box with metas created by plugins and themes but (according to Frederic) it is rather easy to add them in the list using the filter 'pll_copy_post_metas'.
      He mentions that he is not sure that these 'PageLines Meta Settings' are stored in post meta but that would make sense according to him. He asks if the Pagelines dev team will be interested to support this feature in the future.
       
      I'm also wondering if you will consider adding Polylang translation support for manually editable strings like the 'Read more…' strings in Pagelines Settings.
       
      Well that's of course up to you but I thought to let you know to be able to take this into consideration. I also post this for other users in case they experience the same kind of trouble and are looking for an answer.
       
      Best regards,
      Jan Peeters
    • bankrollbuilder
      By bankrollbuilder
      I used a custom hook to put a banner ad in my header. It works but its not in the right position. it is centered and above my logo and I would like to float it to the right of my logo in the header. heres the link: http://shaboopie.com/shaboopie-wp/free-logos-pg1/

      thanks.

      Dan B.
    • starlit
      By starlit
      Can one have two hero sections on one page?

      I want a landing page which leads/advertises two subpages.

      Or is there another option?

      Please help.

      THANK YOU
    • hutruk
      By hutruk
      Hi!

      I am using the shortcodes for tabs, as described in the documentation.

      When I insert the following code:


      [pl_tabs][pl_tabtitlesection type="tabs"] [pl_tabtitle number="1"]Title 1[/pl_tabtitle] [pl_tabtitle number="2"]Title 2[/pl_tabtitle] [/pl_tabtitlesection] [pl_tabcontentsection] [pl_tabcontent active="yes" number="1"] Lorem ipsum dolor sit amet, consectetur adipiscing elit [/pl_tabcontent] [pl_tabcontent number="2"] Lorem ipsum dolor sit amet, consectetur adipiscing elit [/pl_tabcontent] [/pl_tabcontentsection] [/pl_tabs]

      I get a strange output (in the attachment).

      Any ideas?

      Thanks in advance!

    • MooiWeb
      By MooiWeb
      Hello,

      I would like to align my qtranslate with my breadcrumb so that the flags are on the same hight.
      I'm aware of putting a code in the custom css and tryed severall codes from your site but for now, no succes

      The site i'm working on is http://nieuw.vazdias.nl

      Thx,
      Edwin



×