wordpress-theming

Is it possible to host wordpress database from other server

泪湿孤枕 提交于 2019-12-04 14:10:24
I've a problem is that I've to host wordpress database from other server and directory from another server where my domain links, so is it possible to connect wordpress directory from other database which is not on same server, kindly resolve my issue if know the answer. Thanks in advance. Yes, as long as the MySQL server allows the database to be accessed by external servers. When you set up WP, instead of "localhost", you'll put in the SQL server. you can export the current database, then you will create a database on another server, then instead of "localhost" (in the config.php ) you will

How to merge two menu managed separately in wordpress for displaying as one in front end theme?

旧巷老猫 提交于 2019-12-04 12:01:41
问题 I am working on a wp theme for a site which is already built on wp, and having very large menu which is divided into two menu in wp admin. I want to merge this two menu in theme in single UL. Currently it generates two menu in different div container and ul li, and is breaking the styles & js applied on it. How can i merge this two menu into single ul li in single container? 回答1: ok, so if you are using the wp_nav_menu() try using something like <ul id="MyMenu"> <?php wp_nav_menu( array('menu

WordPress 3.5 Media Uploader Multiple File Select

﹥>﹥吖頭↗ 提交于 2019-12-04 11:26:59
问题 I'm building a WordPress theme with a custom settings page. Some of the settings require the user to upload/add a set of images (more than 1). The default behavior of the media uploader is to upload and/or select a single image and insert it into a post. I've followed this excellent guide on utilizing the media uploader, and it suggests that I should be able to set multiple to true, but it still only allows for a single file to be uploaded or selected. Here's my code: Load in the needed

Adding class to gravatar img in wordpress

試著忘記壹切 提交于 2019-12-04 11:18:51
问题 I've been trying to use get_avatar to display the author's gravatar under each post in wordpress template with applied class but I couldn`t find a way to add class="pic-2" to gravatar image code or even changing gravatar heigth and width to 100px and 77px respectively <?php echo get_avatar( get_the_author_meta('ID'), 32 ); ?> Any help guys ?? 回答1: I think the best way to handle this would be to use a filter, rather than using jQuery as George suggests. You would simply add this to your theme

Wordpress custom theme - menu not showing when called in footer.php

只愿长相守 提交于 2019-12-04 10:50:28
I'm trying to create custom website theme for Wordpress and I ran into a bit of a problem. I use two absolutely same menus in my header and footer part of website. Calling wp_nav_menu(array('theme_location' => 'header')); in header.php works well, the menu prints out without any problem, but if I do the same in my footer.php file, the menu doesn't print and var_dump(wp_nav_menu(array('theme_location' => 'header'))); prints false. I've tried some workarounds that I found on Google with modifying the functions.php file, but none of them helped me resolve that problem. My functions.php file now

How do I create different editable sections within a WordPress page?

送分小仙女□ 提交于 2019-12-04 07:29:45
问题 I have been building my first theme on WordPress and have run into problem while adding content into different sections. My HTML is somewhat like this, <div id="maintext"> <-- Text --> </div> <div id="products"> <-- Text and Images --> </div> <div id="about_company"> <-- Text boxes --> </div> How do I make sure the content added via the WordPress editor falls under the respective divs ? For the "maintext" div I'll load the content from the page itself but how do I add content to the other 2

Dynamically change Wordpress Theme

ぐ巨炮叔叔 提交于 2019-12-04 07:14:34
问题 How can I set an a tag to dynamically change the theme currently being displayed by wordpress? I understand the switch function as described in a similar question here: Display page content using multiple templates - WordPress , but I don't know how to implement the change. Should the switch be added to index.php inside a theme, or inside the theme folder? Does my link point to the index.php file? I would like to do this without a plugin if possible. An example of a site which does this

Can Wordpress posts be rendered dynamically?

时光毁灭记忆、已成空白 提交于 2019-12-04 07:07:11
I want to make a blog page which is generating content for particular user based on his/her Facebook likes, activity etc. For example I like Shakira and Coca Cola on Facebook. When entering the blog and connecting via Facebook, the blog gets that info and searches for Shakira's YouTube video through YouTube API and shows me the video in a WordPress post. After the blog searches for news connected with Coca Cola and shows news about it also in a post. There is no problem with FB connect, YouTube search or Google search. My problem is WordPress. As there can be a lot of users and a lot of

How do I show the number of images attached to a post on the image attachment page?

百般思念 提交于 2019-12-04 07:02:50
I use the image attachment page to show images attached to a post one by one, in a slideshow sort of affect. I'd like to be able to display the total number of images attached to the parent post and the number of the particular image that's being shown on any given attachment page so you see the picture and the words "Image 3 of 15" for example. Update... I was able to get the total number to show using this code: <?php global $post; $attachments = get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image',

Does template hierarchy work the same in magento as child themes do in wordpress

蓝咒 提交于 2019-12-04 06:59:03
I am new to magento and i'm confused about themes. I bought a theme and got it installed and now i need to make some changes. In wordpress ... ( which i am used to) what i would do at this point is to make a child theme ( which is essentially one css file with a tiny bit of code in it ) .... and any changes in that child theme would override the parent theme in that area only while the parent theme would govern everything else, the advantage being that when it comes to updating the theme i dont need to maintain a "hacks list" and reimpliment all my modifications. However the people who sold me