wordpress-theming

How stop wordpress creating thumbnails?

对着背影说爱祢 提交于 2019-12-11 19:36:48
问题 How can I stop Wordpress from making thumbnails? It uses a lot of my nodes, and memory! How can I do this? PS: My Wordpress site creates 3 images per uploaded image. (and I have galleies of 20-30 images per article => sooooooooo much nodes and memory)... 回答1: It's very simple to do this... You have no visible option "stop Wordpress making thumbnails". You must do the following: Go to Settings -> Media Uncheck "Crop thumbnail to exact dimensions (normally thumbnails are proportional)" if is

wordpress woocommerce show breadcrumbs in checkout page?

痞子三分冷 提交于 2019-12-11 19:25:15
问题 I am using woocommerce plugin for one of my store with wordpress. Here its working fine. Now for the breadcrumbs it has already in built breadcrumb feature in it. Its working fine. Now I want the breadcrumb feature in my checkout page. But woocommerce shows breadcrumb in all pages except checkout page. So can someone kindly tell me how to solve this issue. Any suggestions will be really appreciable. Thanks. 回答1: May be helpfull for you There are two files you need to change your breadcrumb's

Fatal error: Call to undefined function add_filter() in index.php in Wordpress

倖福魔咒の 提交于 2019-12-11 18:01:14
问题 I want to change my wordpress theme dynamically by user browser. So I found this code on the net and added it to my index.php file add_filter('template', 'switch_theme_by_browser'); add_filter('stylesheet', 'switch_theme_by_browser'); function switch_theme_by_browser($theme) { $browser = $_SERVER['HTTP_USER_AGENT']; if(preg_match('/MSIE/i',$browser) && !preg_match('/Opera/i',$browser)) { $theme = "twentyeleven"; } elseif(preg_match('/Firefox/i',$browser)) { $theme = "twentyten"; } elseif(preg

remove the add new page with no plugins

孤街浪徒 提交于 2019-12-11 16:18:49
问题 i want to remove users the ability to add new pages in wordpress. but sill can edit them. im using Members plugin but for them its all or nothing. i can hide all of the Pages (including the edit and reading capabilities). i have tried a few more big plugins how do the same. so i want to write my on code. i have found some help but for only part of the problem for example this code remove only the sidemen but dont remove the add new button in the wp-admin/edit.php?post_type=page page or in the

WordPress: Override parent theme class function in child theme

[亡魂溺海] 提交于 2019-12-11 15:35:00
问题 I want to override function in child theme, which is defined inside a class in parent theme. Here is the sample code: class A extends B{ function __construct(){ $this->add_ajax('sync_post_data', 'need_to_override'); } //other functions function need_to_override(){ //function code } } Additional Information: Class B extends Class C and Class C is the root class where add_ajax is defined. What I've tried: As the function is not pluggable so I can't override function directly in child theme.

Why does this code make my screen go blank in admin when I put it in functions.php?

谁说我不能喝 提交于 2019-12-11 13:56:01
问题 When publishing content or changing any settings in the admin, the screen goes blank, I found that it's due to this code in my functions.php file. Is there something wrong with it? <?php if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name'=> 'Footer', 'id' => 'footer', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<div class="title">', 'after_title' => '</div>' )); register_sidebar(array( 'name'=> 'Right-Sidebar', 'id' => 'rightsidebar', 'before_widget

How to enqueue second stylesheet in Wordpress child theme?

本小妞迷上赌 提交于 2019-12-11 13:53:50
问题 I'm using a child theme and need to enqueue the stylesheet for a slider. The css file is located in a folder in the parent theme directory, i.e. /parent-theme/css/flexislider.css I created the child theme using a plugin which added a functions.php file to the child theme directory with the following code: <?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp

Alter the Main WP_Comment_Query (comments at the bottom of posts)?

别等时光非礼了梦想. 提交于 2019-12-11 13:28:32
问题 My plugin retrieves a few comments at the beginning of the post through my own WP_Comment_Query. I save these IDs so I can then alter the WP_Comment_Query request and not fetch these IDs. When I use the pre_get_comments hook to hide these already-fetched IDs, they are also hidden from my first query at the beginning of each post. It defies the point. $this->loader->add_action( 'pre_get_comments', $plugin_public, 'hide_the_comments' ); public function hide_the_comments( $comment_query ) {

How do I load jQuery for only one specific page in my WordPress theme?

╄→гoц情女王★ 提交于 2019-12-11 12:15:29
问题 I'm fiddling with a WordPress theme. I'm aware I can use wp_enqueue_script in my header.php to load WordPress's supplied jQuery library. I was just going to use wp_enqueue_script in my header, but it seems inefficient when I only want to use it on a particular Page (just on one single page with a particular page_id.) Given that, what's the best way of including jQuery only on one particular Page ? Presumably I can't do page_id detection in header.php, because that won't be in The Loop, right?

Products are too close in wooCommerce with 2013 WordPress theme

若如初见. 提交于 2019-12-11 10:58:10
问题 I have installed wooCommerce plugin in WordPress, then activated the "Twenty Thirteen" theme and have added 4 products. Does anybody please know how to fix the problem, that the products are show too close and their "Add to basket" labels overlap (at least in Russian language, here fullscreen)? I have tried different widget configurations, like removing the basket from the right side - this doesn't help. If needed, I'm comfortable with editing JS, CSS and PHP files - but don't know WordPress