Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Adding FAQ's to a text widget, and site is loading so slow WordPress

  • SOLVED

Here is the site I am working:

http://www.lesliemoorelaw.com/

The theme I used is called [[LINK href="http://www.vivathemes.com/wordpress-themes/revival-theme/"]]Revival[[/LINK]]

I am trying to figure what the best to place an FAQ section on the home page would be utilizing a text widget. Right now the section you see entitled "Frequently Asked Questions" is a widget in the theme. I want to be able to utilize an FAQ plugin within that section. Is that possible? If not is there a simpler solution that would work with this theme?

Also, the site is loading extremely slow. It is hosted on godaddy and i have not enable any cache plugins as they seem to interfere with seeing edits when I refresh. Any other pieces of advice that may help speed this site up?

Answers (5)

2010-11-10

Nick Parsons answers:

I'd suggest adding a custom widget that displays the FAQ plugin code. You can put this in functions.php:
function display_faq($data){
echo $data['before_widget'].$data['before_title'] . 'Frequently Asked Questions:' . $data['after_title']. '<div class="latest-tweet">';

//call plugin function that outputs FAQ's right here

echo $data['after_widget'];

}
register_sidebar_widget('FAQ','display_faq');


Not sure about the slow load time ... I can tell it's the page itself that's loading slow, not any images or scripts, but I'll have to look around some more and see if I can tell why. I'll let you know if I can figure out anything :)


Jorge Gonzalez comments:

Nick,

I'm a bit of a nube at this and I'm not terribly certain where in the functions.php file your snippet should go. It seems I would also need to add some bit of php to my index.php and page.php files, no? What can we do to facilitate implementing this? Can talk over skype?

The loading issue is solved. I'm using the Cloudflare plugin and have created an account with them. It seems the site loading much much faster.


Nick Parsons comments:

Jorge,

Glad to hear the slow loading is solved! That snippet I gave you can go anywhere in functions.php, it doesn't really matter (just don't put it before the opening "<?php" tag; right after that first "<?php" would work great). It will cause a custom widget to display on the widgets manager page, which you can drag over and use in place of the text widget.

If you can tell what the name of the FAQ plugin you're using is, I can even add the function call in there for you.

Thanks,
Nick


Jorge Gonzalez comments:

I'm using the CMS Settings plugin that has a built in FAQ option to put into pages. Is there a better plugin you recommend?


Nick Parsons comments:

The CMS plugin is fine. Here's the completed snippet you can put at the beginning of functions.php:
function display_faq($data){
echo $data['before_widget'].$data['before_title'] . 'Frequently Asked Questions:' . $data['after_title']. '<div class="latest-tweet">';
echo faq_show(faq_get_questions(1));
echo $data['after_widget'];
}
register_sidebar_widget('FAQ','display_faq');


Nick Parsons comments:

Oops, wait ... I had an extra div tag in there. Here's the corrected version:
function display_faq($data){
echo $data['before_widget'].$data['before_title'] . 'Frequently Asked Questions:' . $data['after_title'];
echo faq_show(faq_get_questions(1));
echo $data['after_widget'];
}
register_sidebar_widget('FAQ','display_faq');


Jorge Gonzalez comments:

That didn't work. Check out the site.


Jorge Gonzalez comments:

sorry. here's the link:
http://www.lesliemoorelaw.com/


Nick Parsons comments:

It doesn't look like you added the custom widget. You have to delete the text widget, and then drag the custom widget over in place of it. I attached a annotated screenshot demonstrating :)