Santiago
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: jquery for child themeAssuming that your js file is located in the path /js/my-child-script.js inside your theme, then adding this in your functions.php should work.
function enque_childtheme_js() { wp_enqueue_script( 'child_theme_js', get_template_directory_uri() . '/js/my-child-script.js', array( 'jquery' ), '1.0', true ); } add_action('wp_enqueue_scripts', 'enque_childtheme_js');And yes, you need to enqueue your style.css file and also the parent theme’s css.
The code in your functions.php should look something like this:
function my_theme_enqueue_styles() { $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );I encourage you to go through the documentation where it is explained clearly.
https://developer.wordpress.org/themes/advanced-topics/child-themes/Don’t hesitate to ask if you need further help. Take care!
Forum: Fixing WordPress
In reply to: jquery for child themeHello @nabeelahs
It is odd that it worked at some point. I understand that you created a .js file for your script and this script is using jQuery. If so, you need to explicitly enqueue the JS file.Check the docs here https://developer.wordpress.org/reference/functions/wp_enqueue_script/
You will find examples at the bottom.Make sure you pass ‘jquery’ into the dependecies parameter to the wp_enqueue_script to be sure that jQuery is already loaded when your script is executed.
Let me know if you ahve further questions.
Good luck!Forum: Developing with WordPress
In reply to: Template development : Comment form not displayYou’re welcome! Glad to help!
And don’t feel bad, most of the issues seems silly after you figure it out 😉Forum: Developing with WordPress
In reply to: Template development : Comment form not displaySorry I wasn’t clear. In the first point I mean if you are 100% sure that the template that you are modifying is actually the template that you are seeing in the front-end. I mean, are the modifications that you introduce in the file reflected in the front end? I just want to rule out this simple issue.
For the second point, I understand that you are using this template for a page.
Remember that comments are disabled in pages by default, even when the comments are enabled for the site. Make sure that comments are allowed for the specific page.
Check this screenshot for further clarification https://ibb.co/cGFQeeForum: Developing with WordPress
In reply to: Template development : Comment form not displayHi there @worksfather,
Hope you are doing well.
The first thing that I would check is if the post is picking the right template by adding adie('some message')into the template file.The second thing that I would check is if the comments for the post are open. Remember that the comment_form() method will do nothing if comments are closed.
Hope this helps to spot the issue. Please keep me posted.
Cheers
- This reply was modified 7 years, 11 months ago by Santiago.
Forum: Fixing WordPress
In reply to: Users and posts tables in database are not accurateHi there erickimani,
Hope you are doing fine.
At first glance, i’d say you are either looking at the wrong DB or the wrong table.
If you’re possitive that the wp-config.php file you’re looking at is the right one (might happen that you’re connected to the wrong ftp), then the first thing I’d look at is the table prefix.
Have a look at the line$table_prefix = 'prefix'in your wp-config.php. If “prefix” is set to something different than “wp_” (this is the default value) it might happen that your posts are being stored into “{prefix}posts”.
So have a look at it and please let me know if it’s been of any help.