- This topic has 8 replies, 2 voices, and was last updated 9 years, 7 months ago by Tom.
-
AuthorPosts
-
September 8, 2014 at 12:49 pm #26262alw
I have created a page template that incorporates the .css files, the .js files and the html code for a basic Accordion, such as that at http://www.jeasyui.com/demo/main/index.php?plugin=Accordion. It works fine if I remove the get_header(); from the template but, of course, there’s no header then! With that line in place, all styling is completely messed up.
Is there a simple solution?September 8, 2014 at 7:12 pm #26347TomLead DeveloperLead DeveloperInstead of removing get_header() – I would add your scripts to the header using GP Hooks.
Link to the scripts in the wp_head section of GP Hooks using the method they show you in the example section when choosing an external script.
Then the functionality should be ready to go on the page.
Let me know if that makes sense ๐
September 9, 2014 at 1:05 pm #26773alwYes, thanks Tom. That makes sense, but I can’t find the example section! If I click “GP Hooks” in the plugins, I am redirected to wp-admin/options-general.php?page=gp_hooks_settings which gives a 500 error — although the page options-general.php is there and goes to General Settings without the querystring. Also https://www.generatepress.com/documentation/ seems to cover everything except GP Hooks.
September 9, 2014 at 1:50 pm #26786TomLead DeveloperLead DeveloperWow – definitely shouldn’t be receiving a 500 error – you may want to contact your host about that and see if they can pinpoint the issue.
As for the accordion – maybe using a plugin would be easier? http://premium.wpmudev.org/blog/10-wordpress-accordion-plugins/
September 9, 2014 at 5:05 pm #26846alwI don’t get an error on wp-admin/options-general.php — only when the querystring is appended — which makes me think that there may be an internal redirection that causes the 500 error?
I have already installed Shortcodes Ultimate (#5 in the “l0 Awesome Plugins”), which does support the Accordion and works. But I am left with the same problem of how to poulate the content of the panes/spoilers dynamically from a database. I want to use an AJAX Post to get the content, so will need to add script inside the content of the page. Can I use GP Hooks to do this?
September 9, 2014 at 8:56 pm #26946TomLead DeveloperLead DeveloperYou can add the necessary scripts using GP Hooks – you just need to know what to add to it.
From the link you sent, it seems you’ll need to download some files and upload them to your server, then link to them like in the example.
Let me know if you need more guidance ๐
September 10, 2014 at 5:07 am #27161alwTom, can you tell me where I can find the examples for using GP Hooks?
Meanwhile, I found a nice way to implement AJAX Posts at http://premium.wpmudev.org/blog/how-to-use-ajax-with-php-on-your-wp-site-without-a-plugin/. It works great!
September 10, 2014 at 11:05 am #27214TomLead DeveloperLead DeveloperAs an example – in your first post you linked to those accordians.
They ask you to add this to your head area:
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css"> <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
So you would upload the needed files and then link to them in the above href section.
This would go into the
wp_head
section of GP Hooks.Does that make sense?
September 21, 2014 at 4:47 pm #32584TomLead DeveloperLead DeveloperGoing to mark this resolved. Reply in here to re-open if you need to.
-
AuthorPosts
- You must be logged in to reply to this topic.