How to support letting users add their OWN logo to a custom theme?

You can create a basic theme options page using the WordPress settings api Here is a simple example that will create an input field for the user to enter a path to the custom logo. // Add a menu for our option page add_action(‘admin_menu’, ‘prefix_myplugin_add_page’); function prefix_myplugin_add_page() { add_options_page( ‘My Theme Options’, ‘Theme Name Options’, … Read more

Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?

Enqueue the script as you would normally, & then call the JS function right after the slider HTML output (or on wp_footer), and pass a JSON config back to the function. <!– slider HTML –> <script type=”text/javascript”> jQuery( “#my_slide” ).mySlider( <?php echo json_encode( $my_config /* array or object of arguments */ ) ?> ); </script> … Read more

WordPress theme options error

First, change your code into the following: $value = get_option( ‘mytheme_value’ ); query_posts ( “meta_key=post_views_count&orderby=meta_value_num&order=DESC&meta_value={$value}”); When you use single quotation marks, php isn’t parsed in the string, and functions (like get_option) will never be called from within a string. Therefore, call the function get_option first, and put the value in a double quoted string (which … Read more

What is the meaning of WordPress’s recommended css classes and where are they applied?

These classes are generated by WordPress. For instance, if a user inserts an image in his post and says it must be aligned right, WP will generate code like this in the post: <img class=”alignright” src=”https://wordpress.stackexchange.com/questions/247130/…”> Now, if your theme doesn’t define the alignright class, the image won’t be aligned right and the user won’t … Read more

Additional custom header image

See TwentyEleven to get the idea: it uses register_default_headers() to add new header images. In your plugin or theme just add: add_action( ‘after_setup_theme’, ‘wpse_42529_add_header_images’ ); function wpse_42529_add_header_images() { register_default_headers( array( ‘a_short_name’ => array( ‘url’ => ‘%s/images/headers/a_short_name.jpg’, ‘thumbnail_url’ => ‘%s/images/headers/a_short_name-thumbnail.jpg’, ‘description’ => __( ‘Wheel’, ‘twentyeleven’ ) ), ‘another_image’ => array( ‘url’ => ‘%s/images/headers/another_image.jpg’, ‘thumbnail_url’ => ‘%s/images/headers/another_image-thumbnail.jpg’, … Read more

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