wp_enqueue_script being ignored in custom theme

You can better try this way and let me know. function wpb_adding_scripts() { wp_enqueue_style( ‘slider’, get_stylesheet_directory_uri() . ‘/css/calculator.css’); wp_enqueue_script(‘jquery’); wp_enqueue_script(‘calculator_script’, get_stylesheet_directory_uri() . ‘/js/calculator.js’); } add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_scripts’ );

Relative Time On Posts

WordPress actually has an obscure and little known function called human_time_diff() that does this. It takes two arguments; the first is the earlier timestamp, and the second is the later timestamp. Both should be Unix timestamps. The first argument is required, but the second is optional, and will use time() if left empty. So, for … Read more

What are the Theme tags in style.css used for?

The theme tags are used to sort/categorize themes in the WordPress theme directory according to features or characteristics. For example, if your theme supports two columns (a typical blog format), then you use the two-columns tag and if it supports multiple screen sizes, use the responsive-layout tag. This makes it easier for someone looking for … Read more

how do I get a sidebar’s id or number for use with is_active_sidebar()

Found a solution to the problem. I added a line of code id => ‘my-sidebar-id’ to the register_sidebar array so now i know the sidebar ID. There may be another way of doing it but this method seems to work fine for me now anyway. if ( function_exists(‘register_sidebar’) ) register_sidebar(array( ‘name’ => ‘Right Sidebar’, ‘id’ … Read more

Get attachments by user

Use a custom query for this. $user_id = 1; $the_query = new WP_Query( array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘author’ => $user_id) ); if ( $the_query->have_posts() ) while ( $the_query->have_posts() ) : $the_query->the_post(); the_title(); endwhile; This will show all the attachment titles for user with user id 1. You can use get_the_ID() in the … Read more

Custom php page in WordPress theme?

Move the template files out of the subdirectory, and put them in the Theme’s root directory. Then, if you simply want to include the contents of those template files in other template files, simply call get_template_part( ‘test-page-name.php’ );. If you insist on keeping these files in a subdirectory, you’ll need to include them via locate_template().

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)