wordpress-theming

Loosing Nav Active State in Wordpress Dynamic Menu

↘锁芯ラ 提交于 2019-12-12 04:45:56
问题 In the following section: http://www.zimmernutrition.com.php53-23.ord1-1.websitetestlink.com/learning-center/ In the sidebar, if you click "Health Articles" and click one of the categories, the active "orange" state of "Learning Center" is lost. Articles are a custom post type and the categories are a related custom taxonomy. Not sure if the menu is coded incorrectly, the CPT, the custom taxonomy or some combination. Thanks for any help. Brett 回答1: Just for the record mine works. I'm using

WordPress theme is not being recognized because Stylesheet is missing

ε祈祈猫儿з 提交于 2019-12-12 04:43:09
问题 My original attempt to install the theme through WordPress dashboard did not work and gave me the following error: The theme is missing the style.css stylesheet. So I manually uploaded the unzipped files into a New Theme folder under wp-content/themes. Now I’m looking at my css files in wp-content/themes folder they are all there and match-up to the original files in the zip file which I originally downloaded. I tried moving files up from the original sub-directory as some of the WordPress

Change widget's CSS class names for different category pages in WordPress

半城伤御伤魂 提交于 2019-12-12 04:07:27
问题 I want to change the class names of the sidebar widgets on every different category page of WordPress and I figured the best way to do this would be to make a function in functions.php with all the conditions and return the required class name. I then called the function in the list tags of the register_sidebar function. if (function_exists('register_sidebar')) { register_sidebar(array( 'before_widget' => '<li class="sidebarModule">', 'after_widget' => '</li><!-- end module -->', 'before

WordPress sub-menu will not appear visible and instead appears with scrollbar in header

隐身守侯 提交于 2019-12-12 03:44:08
问题 I would like the sub-menu to appear visible (like a normal sub-menu) instead of hiding under a scroll bar but I have become stuck http://postimg.org/image/yqe0nz2p7/ CSS .nav { float: right; display: inline-block; width: auto; position: relative; } .nav > ul > li { margin-right: 55px; overflow: visible; } .nav > ul > li > .sub-menu { position: absolute; padding-left: 0px; background-color: #fff; border-radius: 2px; border: 1px solid #ddd; z-index: 2; } HTML: <nav class="nav" role="navigation"

How to add custom font in my theme?

蓝咒 提交于 2019-12-12 03:37:04
问题 now, i want to use Monotype Corsiva. i add the font in my theme ,then in css file using font-family:Monotype Corsiva ,but some one tips me: font used for site title and headings is not working if it's not installed on users system. You should either remove font file from theme directory or include it in css file in apropriate way. how to include it in css file in apropriate way? thank you 回答1: You need to use @font-face with your font in either .ttf or .eot Below is an example @font-face {

Ajax call add current url in wordpress

北战南征 提交于 2019-12-12 02:34:25
问题 When I am trying to perform an ajax call using jquery in wordpress js file, it automatically redirects to current path and then appends my custom path so I can't redirect my true URL. Here is my code: var path_test = document.location.hostname + '/wpcontent/themes/expression/imagecount.php'; var path; $.ajax({ url: path_test, type: "GET", data: '30' }).done(function() { alert('ajax call success'); }); It adds path, but first adds current URL then adds my URL so ajax call fails. 回答1: For any

How to make wordpress shortcode

末鹿安然 提交于 2019-12-12 02:27:53
问题 I have this code to show all post of category and thumbnail for 1st post of them. <?php $recent = new WP_Query(); ?> <?php $recent->query( 'cat=1&showposts=5' ); ?> <?php $is_first_post = true; ?> <?php while( $recent->have_posts() ) : $recent->the_post(); ?> <ul> <li> <?php if ( $is_first_post && has_post_thumbnail() ) { the_post_thumbnail(); $is_first_post = false; } ?> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a> </li> </ul> <?php endwhile; ?> but i want show this using

Better Search box for wordpress

吃可爱长大的小学妹 提交于 2019-12-12 02:25:42
问题 Please take a look on this WordPress theme, when you click on search icon, a search box appear in the middle of page with a cool effect. I want to add this to my WordPress site. I have looked on google but still no luck, Please suggest me a plugin or article. Thanks 回答1: Hi There it work like this using bootstrap modal popup. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js

Wordpress - check if current page has given tag ID

独自空忆成欢 提交于 2019-12-12 02:16:27
问题 I am using WordPress custom taxonomies. How to check if the current page has tag_ID = "XXX" ? If that is any help the URL on the admin page looks like this: http://localhost/website/wp-admin/edit-tags.php?action=edit&taxonomy=company&ta‌g_ID=13&post_type=news The code currently used, but not working: if (has_post_thumbnail()) { the_post_thumbnail(); } else { if (is_object_in_term($post - > ID, 'post_tag', '13')) { // ID 13 } if (is_object_in_term($post - > ID, 'post_tag', '12')) { // ID 12 }

passing argument using add_action in wordpress!

穿精又带淫゛_ 提交于 2019-12-12 01:58:20
问题 I have a very strange problem in my wordpress development, in fucntions.php I have the following code //mytheme/functions.php $arg = "HELP ME"; add_action('admin_menu', 'my_function', 10, 1); do_action('admin_menu',$arg ); function my_function($arg) { echo "the var is:".$arg."<br>"; } the output is the var is:HELP ME the var is: Why the function repeated 2 times? Why has the argument "help me" been passed correctly and the 2nd time it havent been passed? I have been trying all my best for 2