CIVICRM won't output jQuery files - wordpress

I have the latest version of Wordpress and CiviCRM installed and for some reason CiviCRM won't enqueue the jQuery files necessary on my custom theme but it does indeed work if I switch the custom theme to the default WP theme. How is this possible? I disabled all my plugins, functions.php file, created a very simple page.php template (update: i even created a simple theme with just a style.css and index.php file):
<?php
wp_head();
if (have_posts()) {
while (have_posts()) {
the_post();
the_content();
//
} // end while
} // end if
wp_footer();
?>
and I receive the following JS error:
Uncaught ReferenceError: cj is not defined
Any help would be appreciated, thanks.

It seems like plugins>civicrm>js>jquery.conflict.js may not have run; but why I can't say. What jQuery*.js files does your new WP theme contain? CiviCRM wants to use 'cj' as an alias for jQuery. Can you step thru in Firebug?

Related

Include 3 step php form to wordpress template

Hello i have writen 3 step multipage form in php
Files in form:
first step: start.php
second step: form.php
last step: payment.php
I wonder if there is a way to add this form in wordpress template to page.php file or something?
My form is similar to this https://www.formget.com/multi-page-form-php/
You can include external files in your site by using the Get Template Part function
Here is the function in the codex
You can use it to include any php file that you wish, see the naming convention at bottom of the codex page
So i make custom template files with something like this
<?php
/*
Template Name: OrderBM-1
*/
get_header();
include (TEMPLATEPATH . "/orderForm/start.php" );
get_footer();
?>
Files that i include, i paste in theme directory "wp-content/templates/temp-name/orderForm"

WordPress Calling Function Outside

How to get value using
<?php get_theme_mods('emailaddress') ?> in file insde theme folder?
Actually I have registered a field to set email from WordPress customize section. <?php get_theme_mods('emailaddress') ?> is working fine when I display on WordPress pages or posts but it does not work when I try to get value on formhandler.php file inside theme folder.
When form is submitted, the form calls the file formhandler.php inside theme folder. So, I want to get value using <?php get_theme_mods('emailaddress') ?> to use email sent to email.
Why is <?php get_theme_mods('emailaddress') ?> not working inside formhandler.php file? This file just process the form and sends email.
Include wp-load.php at the top of formhandler.php. You will find wp-load.php in the root. If formhandler.php is on the root of your active theme then use the following include statement.
<?php include '../../../wp-load.php'; ?>

Wordpress Language file is not being loaded

I seem to have a problem loading Wordpress language files into my custom theme.
In functions.php I have the following code in my setup:
load_theme_textdomain( 'theme_textdomain', get_template_directory() . '/langs' );
In my stylesheet I have the textdomein defined:
Text Domain: theme_textdomain
In my theme folder I have a folder /langs with 2 different file types:
en_GB.mo
nl_NL.mo
Default language of my theme is nl_NL.
In one of my templates I use:
<?= __('Zoeken'); ?>
Just to test I added a translation of this in both language files:
For en_GB = search, for nl_NL = zoeken2. However, both nl_NL and en_GB are not being loaded by the theme. What I'm I doing wrong?
I think you need to specify your theme domain in your call to the __() function. I don't think it's picked up automatically from your stylesheet header. So rather than
<?= __('Zoeken'); ?>
try
<?= __('Zoeken', 'theme_textdomain'); ?>

How to add comments to a WordPress theme

How can I add comments to my WordPress theme. I tried <?php comment_form(); ?> but it doesn't give any output. Am I missing something?
Just add the following line
<?php comments_template(); ?>
inside your single.php where you want to add/display the comments template. This will add/include the comments.php file in the single template and make sure that comments.php is also available in your theme folder.
Also you can use Disqus wordpress plugin, it's a very nice plugin.
References: Codex and a tutorial.

Blog page with theme completely different from the main theme?

I have been trying to make my website on Wordpress. I am using Brave Zeenat as my primary and Grido as my blog theme.
I have read many tutorials in places, which discuss how to apply a customized flavour of the main theme on a static page, e.g. Blog. However, the main theme I am using does not appeal to me as a blog theme at all, so I wanted to do something entirely different, so I have tried two methods.
First, I tried to just create a page named Blog and force it to take a theme of my choice using the Page Theme plugin. That worked instantly, but the blog page is empty and would not accept articles of certain categories by default like this.
Second, I tried to not use any plugin at all, and use a custom PHP file instead, which sets some loops and calls a theme. This file blog.php had to be in the main theme directory, otherwise it would not be applicable as a template from the page settings in Wordpress dash.
So I put it with my main theme, but call to load the other theme, like this:
<?php
/*
Template Name: Blog
*/
$paged = get_query_var('paged');
query_posts('cat=0&paged='.$paged);
global $more;
$more = 0;
load_template(WP_CONTENT_DIR . '/themes/grido_v1.0.1/index.php');
?>
Eventually I only want to see category no.9, but for now, I left it as 0, which should display all categories. But when I run this with Page Theme plugin disabled, I get this error: Fatal error: Call to undefined function themify_get() in /var/sites/v/visualdeceptions.info/public_html/wp-content/themes/grido_v1.0.1/index.php on line 10.
Now, although this is a themify error, I am sure if I try to use other premium themes as well, I will encounter very similar errors, because I have only set a custom php file, and no style, header, footer, etc. But I am not sure how to do it.
Try to add getheader() and getfooter() in the code
<?php
/*
Template Name: Blog
*/
get_header(); //HERE
$paged = get_query_var('paged');
query_posts('cat=0&paged='.$paged);
global $more;
$more = 0;
load_template(WP_CONTENT_DIR . '/themes/grido_v1.0.1/index.php');
get_footer(); //HERE
?>

Resources