wordpress-theming

How do I add A Div around each WordPress post image ? [closed]

送分小仙女□ 提交于 2020-01-16 18:46:27
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I want to add a div around every image that is posted on my wordpress blog post. How can I do it? (For the curious ones, I'm attempting to pop out some share buttons whenever a user hovers over an image). 回答1: Add the following snippet of code into your functions.php file: add_filter( 'image_send

Wordpress custom url writting not working

喜欢而已 提交于 2020-01-16 09:01:29
问题 I want to create my own url like this http://localhost/wptest/content/programs/trainings-conferences/ I have create my own plugin and use this code. add_action('init','wpyog_add_rewrite_rules'); add_action('init','wpyog_add_rewrite_rules'); function wpyog_add_rewrite_rules(){ add_rewrite_rule('^content/([^/]*)/([^/]*)/?','index.php? content_category=$matches[1]content_slug=$matches[2]','top'); } add_action('query_vars','wpyog_add_query_vars'); function wpyog_add_query_vars( $qvars ) { $qvars[

Load javascript code after jquery.js has loaded in WordPress site

雨燕双飞 提交于 2020-01-14 14:13:29
问题 I have a custom jquery-based slider on homepage of a WordPress site. I'm loading jQuery (jquery.js) and the slider js (jquery.advanced-slider.js) using below code in my functions.php file of my theme. function my_load_scripts() { if (!is_admin()) { wp_enqueue_script("jquery"); if (is_home()) { wp_enqueue_script('theme-advanced-slider', get_template_directory_uri().'/js/jquery.advanced-slider.js', array('jquery')); wp_enqueue_script('theme-innerfade', get_template_directory_uri().'/js

remove published post notice while error handled

孤街浪徒 提交于 2020-01-13 06:17:09
问题 im creating an error handler for a custom post type. add_filter( 'wp_insert_post_data' , 'filter_post_data' , '99', 2 ); function filter_post_data( $data , $postarr ) { //error handling if($data['post_type'] == 'post_annunci') { if($postarr['annuncio_prezzo'] == '' || !is_numeric($postarr['annuncio_prezzo'])) { $errors .= 'Annuncio non salvato, devi inserire un prezzo con valori numerici.</br>prezzo = '.$postarr['annuncio_prezzo']; update_option('my_admin_errors', $errors); $data['post_status

Why does my page redirect to localhost in my wordpress blog?

左心房为你撑大大i 提交于 2020-01-12 04:45:34
问题 This is my site URL http://www.weblogicsol.com/ , Here I installed a wordpress theme having URL http://www.weblogicsol.com/blog , the problem is this when I want to open the wp-admin (means when I write http://www.weblogicsol.com/blog/wp-admin) it redirect to localhost . Please help me to solve this problem, I am in trouble. And if I write this code in wp-config file define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com'); then this URL appears with an error message.

remove li class & id for menu items and pages list

我与影子孤独终老i 提交于 2020-01-11 15:26:11
问题 Example of WordPress default CSS class output: <li id="menu-item-55" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-55"> <li class="page_item page-item-37"> The menu and pages list item come with various own li class and id . How to remove them in functions.php file for the menu and for the pages list? 回答1: You should be able to remove them by hooking into a couple of filters and returning empty arrays or strings rather than new classes or ids: add_filter('nav_menu

jQuery .html() not displaying any data in ie7, but ie8 works

[亡魂溺海] 提交于 2020-01-11 09:10:12
问题 So who doesn't have issues with ie7 ? It seems that I cannot get ie7 to recognize some data. I have created a wordpress theme for a client of mine, and this allows them to put in extra information in the wordpress meta fields through the admin so they can display extra info. I have written a small jQuery script that looks at an images alt and title to gather this info and write it into a div. Below is my script. <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function(){

jQuery .html() not displaying any data in ie7, but ie8 works

筅森魡賤 提交于 2020-01-11 09:09:27
问题 So who doesn't have issues with ie7 ? It seems that I cannot get ie7 to recognize some data. I have created a wordpress theme for a client of mine, and this allows them to put in extra information in the wordpress meta fields through the admin so they can display extra info. I have written a small jQuery script that looks at an images alt and title to gather this info and write it into a div. Below is my script. <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function(){

Overiding parent theme functions with a Child theme in WordPress

混江龙づ霸主 提交于 2020-01-07 16:33:07
问题 I am trying to override the Parent theme function.php file with a function i have in my child themes function.php file but i'm getting a couple of errors. Here's what iv'e done so far.. function remove_et_postinfo_meta_actions() { remove_action('after_setup_theme','et_postinfo_meta',3); } add_action('init', 'remove_et_postinfo_meta_actions'); add_action('after_setup_theme', 'cc_et_postinfo_meta', 3); if ( ! function_exists( 'cc_et_postinfo_meta' ) ){ function cc_et_postinfo_meta( $postinfo,

Overiding parent theme functions with a Child theme in WordPress

爷,独闯天下 提交于 2020-01-07 16:32:58
问题 I am trying to override the Parent theme function.php file with a function i have in my child themes function.php file but i'm getting a couple of errors. Here's what iv'e done so far.. function remove_et_postinfo_meta_actions() { remove_action('after_setup_theme','et_postinfo_meta',3); } add_action('init', 'remove_et_postinfo_meta_actions'); add_action('after_setup_theme', 'cc_et_postinfo_meta', 3); if ( ! function_exists( 'cc_et_postinfo_meta' ) ){ function cc_et_postinfo_meta( $postinfo,