wordpress-theming

Adding a jQuery script to wordpress Admin

狂风中的少年 提交于 2019-11-29 06:12:12
问题 I cannot for some reason get the wordpress /wp-admin pages to execute a simple query file. It only works if i deregister jquery in my functions.php within my theme folder, but then i must re-register all the jquery.ui files separately which is tedious. Im using wordpress 3.0 multisite installation. I'm trying not to touch the core wp files. It will show in the source and links to the file ok but won't execute the script. heres what i have in my functions.php: function my_script() { if (!is

Exclude the_post_thumbnail from gallery shortcode

拟墨画扇 提交于 2019-11-29 03:31:01
问题 I am using this code to have a simple gallery on the page: <?php echo do_shortcode('[gallery itemtag="ul" icontag="li" size="full" columns="0" link="file" ]'); ?> The problem now is that the end-user has to upload an image via the Media page before selecting this image as featured image. I know this could be solved by adding the featured image's ID to the shortcode's exclude list, but how to get this ID automatically? 回答1: function exclude_thumbnail_from_gallery($null, $attr) { if (!

Using Sass compressed output while leaving theme comment header for Wordpress

痞子三分冷 提交于 2019-11-28 20:28:39
How do other Wordpress theme developers incorporate Sass into their theme development while taking advantage of its compressed output style? Sass compressed removes ALL comments, so I currently have an empty style.css with my theme declaration and an @import calling the minified css from compass, but this hardly seems like the best solution. Has anybody found a way around this? What would be the best solution if not? http://codex.wordpress.org/Theme_Development#Theme_Stylesheet http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#id40 SUPER SHORT VERSION: Use /*! loud comments */ and

Path to WordPress Template Directory inside jQuery?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 19:24:33
My header is calling a javascript file which sends out an email: <script type="text/javascript" src="<?php bloginfo('template_directory') ?>/css/effects.js"></script> But inside this file, I have a jQuery code that calls a .php file that does the actual sending of the email: $.ajax({ type: "POST", url: "css/sendmail.php", data: dataString` But the script doesn't work, unless the url is: <?php bloginfo('template_directory') ?>/css/sendmail.php and not just: css/sendmail.php Is there any way to include a path to the wordpress template directory inside js? Jan Fabry You could create a Javascript

How do I add custom fields to my custom post type in Wordpress 3?

浪子不回头ぞ 提交于 2019-11-28 17:14:23
问题 I created a custom post type with the register_post_type function, and now I want to add custom fields to it. These must be as user friendly and integraded in the GUI as possible. I tried the custom field template but I dont really like it for end users. I prefer to add the new field and a new meta box with code. 回答1: I found this series of tutorials were very helpful: http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/ http://wp.tutsplus.com/tutorials

The requested URL /about was not found on this server

拜拜、爱过 提交于 2019-11-28 15:46:38
问题 The home page of my wordpress website seems to be displaying correctly but if you click through to any of the other pages I get the following error message: Not Found The requested URL /about was not found on this server. Apache/2 Server at www.wildlionmedia.co.uk Port 80 I'm not sure whether it's a problem with the theme or the .htaccess file that is not being rewritten correctly. http://www.wildlionmedia.co.uk/ Any ideas how I can resolve the issue? # Switch rewrite engine off in case this

What is the difference between get_the_* and the_* template tags in wordpress?

廉价感情. 提交于 2019-11-28 12:50:13
I am confuse about get_the_* and the_* template tags. I have used those many times to my theme but i am not clear enough when to use get_the_* and when to use the_* . Would you please explain both concept clearly. Typically, there are two key differences between get_the_* and the_* functions. get_the_* methods don't echo anything themselves. Instead, they return the value that you're interested in, normally as a string. For example, get_the_time() echoes nothing, and returns a string representation of the posting time of the current post. the_* methods directly output the same value, without

How to go about modifying the Wordpress “Pages Add New Screen”

假装没事ソ 提交于 2019-11-28 12:49:29
I have been thinking about developing my own theme framework for worpdress. I'd like to use jquery ui to build a bootstrap 3.0 drag and drop interface, which I already have worked out, but I can't figure out how to edit the "Pages Add New Screen" as referenced here: https://codex.wordpress.org/Pages_Add_New_Screen Would I add files to my client side theme that affected my admin structure as well? Does anyone have any suggestions as to how to do something like this. Alot of themes these days come with these drag and drop frameworks and it would be nice, to be able to create one of my own, just

Apply CSS Repeatedly to Specific Words

社会主义新天地 提交于 2019-11-28 10:02:06
问题 I'm trying to apply CSS repeatedly and automatically to specific words. For example, for the word "Twitter" I want the colour of the text to be #00ACED. At present I am manually applying these colours around specific brand terms using span classes: <span class="twitter">Twitter</span> With the CSS: .twitter { color: #00ACED; } However, this is a process and I would prefer a method which completes this styling automatically. I have about 20 brand words with an associated colour styling. Can

woocommerce after login redirect

早过忘川 提交于 2019-11-28 08:50:37
问题 My In my woocommerce login form successful login it is redirection to shop page I did, And after login error it should be same page but it goes /wp-login.php.I got some codes but it is working when I enter wrong username or password but when I put empty user name or password it is going /wp-login.php. Here is the code function my_front_end_login_fail( $username,$password ){ $referrer = $_SERVER['HTTP_REFERER']; if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp