wordpress-theming

Permalink change each post update in wordpress

帅比萌擦擦* 提交于 2019-12-08 06:44:39
问题 I want to have a custom permalink for each new post in WordPress like: http://mysite.com/x5Kvy6. function wp_unique_post_slug($col,$table='wp_posts'){ global $wpdb; $alphabet = array_merge( range(0, 9), range('a','z') ); $already_exists = true; do { $guidchr = array(); for ($i=0; $i<32; $i++) $guidchr[] = $alphabet[array_rand( $alphabet )]; $guid = sprintf( "%s", implode("", array_slice($guidchr, 0, 12, true)) ); // check that GUID is unique $already_exists = (boolean) $wpdb->get_var(" SELECT

Bootstrap Wordpress theme dev - How to use WP loop to generate span6 in a span12 layout

徘徊边缘 提交于 2019-12-08 06:01:34
问题 I'm currently working on a wp theme project and i am trying implement the loop on a class = "span6" in a 12 grid layout, such that it will generate a 2 col magazine grid structure of all my wp post. but the different span six wont align properly, only the first two aligned well. in a static page, i would normally implement the grid layout like so: <div class="row-fluid"> <div class="span6">Content</div> <div class="span6">Content</div> </div> <div class="row-fluid"> <div class="span6">Content

How does my completely blank Wordpress theme works?

我只是一个虾纸丫 提交于 2019-12-08 04:26:41
问题 I made a test. i have a Wordpress site using Elementor page builder (pages, archives, header, footer... everything made with Elementor page builder). Now i made a theme which contains only two files: index.php style.css The index.php file is completely blank. nothing inside it. The style.css file contains the basic theme config comment thing. Everything works great on the site. and my question is why? For example how does the head part adds the used plugins if the theme doesn't contain wp

Why my new users wordpress dont have Post?

ε祈祈猫儿з 提交于 2019-12-08 04:21:41
问题 I try to create a new user to post events, but my new user, called admin , doesn't have the ability to post. I tried changing his role to Editor , Subscriber , Author , and Contribute , but I still cannot post with admin . Currently only the Administrator can post, how can I give admin the rights to do so as well? 回答1: I think your new user role has some limitations. To change the settings of a user role you can use the user role editor plugin. To change the admin menu you can use the

Change HTML language from en-US in to en-GB in WordPress?

本秂侑毒 提交于 2019-12-08 03:06:33
问题 This may sound like a simple and trivial question, but I'm using the following tag in a WordPress theme header file: <html <?php language_attributes(); ?>> Which is outputting: <html dir="ltr" lang="en-US"> I wish to change the lang attribute to "en-GB" as my blog and the language posts are written in are British English (en-GB) but I can't find where this parameter is set in the WordPress admin settings, and there isn't a value for it in the wp_options database table either, which leaves me

Need help with remove_action()

僤鯓⒐⒋嵵緔 提交于 2019-12-07 18:48:27
问题 I'm trying to remove the unsightly embedded <STYLE> tag the built-in Recent Comments widget puts in my <HEAD> , but I can't seem to get the syntax right. It originally calls add_action( 'wp_head', array(&$this, 'recent_comments_style') ); to add it (in wp-includes/default-widgets.php, line 609), and I'm trying to undo it. I think it should be something like this: remove_action('wp_head', 'WP_Widget_Recent_Comments::recent_comments_style'); but with all the variations I've tried I still can't

Cannot add custom page template to my child theme

China☆狼群 提交于 2019-12-07 18:25:38
问题 I'm running Wordpress 3.3.1. I'm writing a child theme that modifies the default twentyeleven theme. Everything seems normal, except that when I add a custom page template, it doesn't appear in the add/edit screen (so I can't use it!). To elaborate on "normal", here's what IS working: My child theme appears and activates normally. My CSS code (in style.css) is appearing. My files from the template hierarchy are working (ex: front-page.php, page.php) I've read and reread the codex, and my

Creating a “repeater fields” without a Plugin

让人想犯罪 __ 提交于 2019-12-07 18:14:22
问题 I want to create a repeater meta box without using any type of plugin. How can I get this metabox in my "selected template"? 回答1: add_action('admin_init', 'gpm_add_meta_boxes', 2); function gpm_add_meta_boxes() { add_meta_box( 'gpminvoice-group', 'Custom Repeatable', 'Repeatable_meta_box_display', 'page', 'normal', 'default'); } function Repeatable_meta_box_display() { global $post; $gpminvoice_group = get_post_meta($post->ID, 'customdata_group', true); wp_nonce_field( 'gpm_repeatable_meta

Add widgets to custom WordPress sidebars on theme activation?

不羁岁月 提交于 2019-12-07 16:59:41
问题 I'm working on a WordPress 3.0 multi-site installation. Each new blog will use the same theme with slight modifications (a custom Thesis install, if it matters). I'm trying to automate the set-up process for each new blog as much as possible. To that end, I'd like to automatically add widgets to my custom sidebars and widget-enabled footers. It'd be even better if the widgets could have pre-set parameters/content, that I or the blog owner could then go into the Widgets panel and edit. I've

How to use Classic Editor with WordPress 5.0

落花浮王杯 提交于 2019-12-07 15:19:29
Recently I updated the WordPress version to new 5.0 version. After the update it is showing me a different editor than I worked before. But I want to access previous editor I worked with. How can I get back to former WordPress editor? Recently WordPress introduces its version 5.0. With this version WordPress has introduces the block-based editor instead of using former classic editor. How to get back to former editor? You need to install and activate Classic Editor plugin . This will add new Classic Editor editor option. For more details about installing a plugin, please refer this guide on