question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
Hi I am thinking of releasing a plugin, it seems that WordPress pushes for all plugins to be released as GPL. I have no problem with that, but I've noticed that Gravity forms plugin is GPL + requires a licence key. Is it ok to issue a plugin under the GPL licence but then require a licence key for it to work? | If a plugin is GPL, you have the right to modify, tweak, rebuild, and otherwise hack the plugin at your leisure. You also, under the GPL, have the right to redistribute your modified version and, ultimately, the unmodified version as well. The Gravity Forms license key is for support and updates. If you don't have a li... | Open Source plugin and requires licence | wordpress |
I have a hosted free wordpress blog. Now I am thinking to move that blog to self-hosting. What I already have /know/tried: 1: I have a domain name purchased from a companyA. 2: I have hosting accounts Linux as well as ASP.NET with the same companyA. 3: From the cPanel of companyA I can go and install wordpress. I tried... | The article you linked to covers everything you need to know. I will just clarify what you do not understand and what is outdated. Site Redirect The domain mapping is done through wordpress.com to do a 301 direct, which tells search engines that you have moved permanently to a new address. It is outdated now and supers... | Things to take care when moving from hosted wordpress to self-hosting | wordpress |
Is there a widget for WordPress to show posts from one category with a thumbnail and description for latest post? WIDGET LIKE: Top news section of WWW.GOAL.com. | I don't know of any widgets or plugins that do this by default. To create this within your theme you would need to write multiple query loop that goes through each category then queries the latest posts from each with a counter so the top post can be styled differently. Quick example. <code> $cats = get_categories(); f... | Show posts from one category with thumbnail and description on latest | wordpress |
I have a group of javascript functions in one js file. each function acts on a specific action and get its own ajax response. some are on different pages, some are on the same page. If I don't do the localize, I can't get response. How can I localize this file for multi actions? | Maybe I got your question wrong. I don't get what you mean by: If I don't do the localize, I can't get response. But in general, this function lets you localize your JS strings, but you can also use it to set JS variables: <code> function set_my_js_var() { // logic here for setting the right JS var return "some value";... | How to localized one js file for different actions? | wordpress |
I can't find a good tutorial on the new menu handling functions, and the ones I found don't seem to work for me. What am I doing wrong? In my <code> functions.php </code> : (I'm using the Blank Slate theme as a framework; I'll figure out later what's noise, but it's pretty minimal -- hence the name) <code> function bla... | This: <code> <nav> <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?> </nav> </code> . Should be: <code> <nav> <?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'menu_class' => 'main_menu' ) ); ?> </nav> </code> The css: <code> .main_menu { font-size:... | Menu not styling. New menus functionality giving me a headache | wordpress |
Is it possible to use the user-interface (front-end) part of Wordpress to open comments on all posts in one (or two) clicks? I have many posts with closed comments which must have happened by mistake, and I want to make them all open comments. Here's the caveat: My host provider doesn't give me <code> ssh </code> acces... | I wrote up this quick plugin that updates all posts of type <code> post </code> to <code> comment_status </code> <code> open </code> on activation, it should work for you. you can immediately deactivate and delete it once you activate it that once. <code> <?php /* Plugin Name: update comment status */ function activ... | Opening all posts for comments | wordpress |
WP Customer Reviews Plugin Looking for some shortcodes for displaying the review form only / reviews only . On the plugin page there is an info about shortcode ( Shortcodes available for inserting reviews and review form on any page or widget ), but I cannot find theme anywhere. http://wordpress.org/extend/plugins/wp-c... | The plugin registrer some shortcodes in wp-custom-reviews.php: <code> add_shortcode( 'WPCR_INSERT', array(&$this, 'shortcode_wpcr_insert') ); add_shortcode( 'WPCR_SHOW', array(&$this, 'shortcode_wpcr_show') ); </code> Try: <code> [WPCR_INSERT] </code> and <code> [WPCR_SHOW] </code> | WP Customer Reviews - shortcodes | wordpress |
I've created a menu page in the dashboard, then I created a custom post type and now I want to put the menu of the custom post type as a submenu under the first menu page I had created. I tried 'show_in_menu' => 'admin.php?page=mytestpage', However that did not work. Any tips? | Ended up creating the custom post type and adding my custom page as sub page to that, as suggested by Bainternet | Add Post type menu to another menu | wordpress |
I'm building a plugin to manage course information and am struggling to put form validation on the new meta boxes I've added. Has anyone a good way of putting JS / JQuery validation on the admin menus? Thanks | Ok got it to work. I couldn't find anything on the web about this, bar one guy's page, which did actually work but wasn't quite as good a solution as I'd wanted. I did some research how the main plugins are doing it, and only found some unintuitive custom JS ways. Anyway success I got it to work using a JQuery library ... | JS / JQuery form validation in backend admin menus | wordpress |
I need add to the excerpt field the TinyMCE Advanced editor, any ideas? I have the qTranslate plugin (multilanguage), and it's impossible to connect teh excerpt with this plugin and an editor. Thanks | Just replace the default output. Make sure you unescape the excerpt before you send it to the editor: <code> add_action( 'add_meta_boxes', array ( 'T5_Richtext_Excerpt', 'switch_boxes' ) ); /** * Replaces the default excerpt editor with TinyMCE. */ class T5_Richtext_Excerpt { /** * Replaces the meta boxes. * * @return ... | Adding a rich text editor to Excerpt | wordpress |
I have 100+ categories & sub-categories for a site I'm working on. How can i change the amount displayed in the list of categories (default 20 per page) on the dashboard? | You can set this using the Screen Options tab at the top of the category edit screen: | How to change amount of categories listed on dashboard? | wordpress |
I have a Wordpress multisite installed, and would like to understand how the subdomains actually are managed, ie how does my wordpress multisite knows where to find the files/data when a browser request URL <code> user1.domain.com </code> ? I checked the DNS A record and see only the wild card. I checked the .htaccess,... | During the load process, WP loads <code> wp-settings.php </code> , which calls <code> is_multsite() </code> , which checks for the multisite constant defined in <code> wp-config.php </code> if it is a multisite install. If it is multisite, then <code> ms-settings.php </code> is loaded. Inside <code> ms-settings.php </c... | How does wordpress multisite manage subdomains? | wordpress |
I've tried about anything but I can't seem to get it to work how I would like to so I hope you can help me out. Situation. I have 2 wordpress websites, running on different hosts, only link is a 'commercial' links. they are set up like this. url.com/wp is my wordpress directory, with my index in root. referring. So I h... | You're creating a loop that you can't break out of ... I think what you are saying is you want a visitor to go to <code> domain1.com/index.html </code> and then choose to go to <code> domain1.com/index.php </code> (Wordpress CMS) or <code> domain2.com/index.php </code> Static Homepage in WordPress You're best off to cr... | rename index or homepage | wordpress |
I need to show all my custom articles on an archive page but grouped/sorted by subject. So that the result is somewhat like Subject A: A Sample Post Another Sample Post Subject B: List item A Post About Bacon and so on? I've read some related posts on here stackexchange-url ("17155") and stackexchange-url ("14306") and... | i ended up building a plugin that enforces radio buttons for any taxonomy. http://wordpress.org/extend/plugins/radio-buttons-for-taxonomies/ for the project in question i will probably also save the taxonomy as meta. sucks that i need/want half the ability of taxonomy (knowing other available terms, etc), but need the ... | Create a Metabox that behaves Like a Taxonomy Box | wordpress |
I am trying to configure W3 total cache plugin to speed up my site. The minify option is great but I am running into the following issue: Let's say I have a JavaScript file I am attached <code> wp_localize script() </code> to and it's called <code> 'additions.js' </code> . Because W3TC minifies this JavaScript file and... | W3 Total Cache has 4 locations to include the minified files. Since <code> wp_localize_script() </code> hooks into <code> wp_head() </code> (unless you specify in footer in your enqueue) you can use the <code> before </body> </code> minify location and your script will have access to the variables set. On some oc... | w3 total cache minification breaks wp_localize_script() | wordpress |
I am looking for a way to edit or reset the <code> .htaccess </code> for a wordpress site without access to the filesystem, working only with the wp-admin web interface and/or plugins* (see below for the back story if you're interested or think it's relevant). A quick search on WordPress SE revealed something promising... | You can delete files per plugin if the server’s PHP user has write permissions. The trick is to delete it immediately on activation. Here is a basic sample code: <code> <?php # -*- coding: utf-8 -*- /** * Plugin Name: Delete .htaccess * Description: Deletes the .htaccess file on activation, deactivates itself then. ... | How to change or remove .htaccess per plugin? | wordpress |
<code> function update( $new_instance, $old_instance ) { if( current_user_can( 'unfiltered_html' ) ) { $new_instance['title'] = strip_tags( $new_instance['title'], '<small><span><b><br><a><strong>' ); $new_instance['more_text'] = strip_tags( $new_instance['more_text'], '<div>&l... | If it's outputting it transformed into htmlspecialchars you could just decode it. In your widget() function: <code> echo $before_title; echo htmlspecialchars_decode( $title ); echo $after_title; </code> | Unfiltered html in widget title not working | wordpress |
W3 Total Cache uses all the PHP / WordPress API trickery at hand to make sure all static content (CSS, JS, Images, etc.) is served from the CDN URL. But how does it make sure that even the images referenced in my CSS/stylesheet file are also served from the CDN URL? I checked my CSS file, the path to the images hasn't ... | Okay, the answer is pretty obvious. Let me explain by example: W3 Total Cache makes sure that all the primary static contents on a web page (i.e. ones directly referenced in the source of the web page) are loaded via the CDN URL. So, lets say, W3TC serves the blog's stylesheet from <code> cdn.example.com/wp-content/the... | How does W3 Total Cache Load Images In Stylesheet via CDN? | wordpress |
I have a sport site, where every user who registers is a collaborator by default, and when he writes an article, the people I want can approve it. This is what I want: If someone writes an article about soccer (which is a category), only the editors that I want (so every editor which is subscribed in soccer) will recei... | There is a plugin that (in my opinion) will do just the job for you. It is the "Peter's Collaboration E-mails" . You can find it in the WordPress plugins repository. From the plugin's description: "You can create groups of Contributor users and assign different moderators for each group. In other words, different users... | Specific mail notification | wordpress |
I've got an issue in which my theme's save options routine is being called when a plugin options page (contact form 7) is being saved. This throws an error that points to my "for each" loop inside my theme options save. Am I doing something wrong here? <code> add_action('admin_menu', 'mytheme_admin'); /* ADMIN PANEL **... | maybe you have to change the structure of your theme options page and use add_theme_page() to avoid this type of problems <code> /* REGISTER THEME OPTION PAGE */ if ( ! function_exists( 'RMH_admin_menu' ) ): function RMH_admin_menu() { global $theme_name; add_theme_page( 'Opções para o tema '.$theme_name, 'Temas Opções... | Theme options save routine clashes with plugin save | wordpress |
I cannot get a Google AdSense ad to show up in a WordPress blog I'm working on. The ads have been approved and I entered the code (and double-checked the code to make sure I had it right). The code is as follows: <code> <div id="ads_sidebar"> <script type="text/javascript"><!-- google_ad_client = "ca-pub... | Just make sure to wait at least 30 - 60 minutes after you placed the ads, because it will take some time for the ads to adjust to your website (content wise). You can already check your website if the code is already there by following these steps: Go to the page where your ads suppose to be Check the source code Look ... | Google AdSense Ad not showing up in WordPress Blog | wordpress |
I have a Wordpress function that loops thru 10 input fields & saves the data from those input fields. The data entered is either an absolute or relative link to an image. The loop looks like this. <code> <?php for ($i = 1; $i < 11; $i++) { ?> <input type="text" name="<?php echo 'fresh_banner'.$i ?>... | This is more a basic PHP question than a WordPress one! <code> $settings = get_option( "freshThemeSettings" ); $random = rand( 1, 11 ); if ( isset( $settings[ "fresh_banner$random" ] ) ) echo $settings[ "fresh_banner$random" ]; </code> | Randomly Display One Image From a 10-Image For Loop | wordpress |
I have an application which has the following structure on the user/frontend side: <code> usercontroller: generates output userformhandler: processes user input and redirects back to usercontroller </code> So, when the user inputs data the following type of URL is called: <code> http://localhost/wordpress/?page_id=4&am... | You should be sending your header(s)/processing the request before the template loads. In fact, a hook was added specifically for this: <code> template_redirect </code> | noheader on the user/frontend side | wordpress |
I'm not sure what this is called and have not had much success searching for it yet. In a plugin settings page, I would like a 'combo box' or 'drop down box' that also includes the ability to add an option that is not currently included. That newly added option would be added to the options in the box from that point o... | If you want to do it dynamically on the page you need javascript. This tutorial explains how to add a items to a <code> <select> </code> box. You would have a textbox, the user would type that information in, when they press a button, that would trigger a JavaScript function like the one in the tutorial. Does tha... | Combo/Drop down box on plugin settings page that allows additional options to be added | wordpress |
I use this link to get most viewed posts: <code> http://mydomain.com/?post_type=movies&meta_key=post_views_count&orderby=meta_value&order=ASC </code> But that gives me ALL posts from this post type in order of the most viewed - but I'd like to have only the latest most viewed posts from that custom post typ... | Have you tried this plugin : WP Most Popular ? You can display popular posts from the last day, 7 days, 30 days or all time. From the "Other notes" page : Usage There are two ways in which you can use this plugin. As a sidebar widget Custom function in your theme files Using the widget is the easiest way and recommende... | show most viewed posts of last days by link? | wordpress |
I've enabled custom posts types <code> add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) ); </code> The default post type is set on <code> Standard </code> , and it works for all but the <code> Standard </code> type, when I have a standard post the <code> get_post_format... | Because "Standard" is not a format itself - it simply implies that the post has no formats . ...which is somewhat deceptive, given it's listed in the Format meta-box as a format to choose I think "standard" quite clearly implies what it means. If you're creating a site in which a post is never "standard", then fallback... | Why is get_post_format() for "Standard" returns empty | wordpress |
I'm trying to export a specific category with it's sub-categories. However, Wordpress export option allows either to export all of the categories or to export one specific category at a time. Is there any solution? Thanks. | Workaround: export all import on a blank install (e.g.: in your computer) delete the unwanted ones export again | export category and sub-category | wordpress |
In context of the template hierarchy chart? From what i gather, the paged.php file is something to do with an archive? | If we look in <code> template-loader.php </code> , we can see the conditions under which <code> paged.php </code> will be loaded: <code> if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) : $template = false; if ( is_404() && $template = get_404_template() ) : elseif ( is_search() && $template = g... | What's the purpose of the paged.php file? | wordpress |
I'm looking for a way to delete default category functionality in wordpress but after i delete the default category in <code> wp_terms </code> table in mysql database, it automatically assigns default category to another category. Does anyone know how to achieve this? Thank you for any help. | Impossible. WordPress requires a default category, that’s hard coded. If you need a taxonomy without default value – create a custom taxonomy . | Deleting default category in wordpress | wordpress |
I have the cPanel access to a website but no wordpress login info. So I wants to change a widget content in the website. How can I change it through phpmyadmin. Where are that widgets sidebar data actually stored? Is it inside <code> wp-options </code> table? | I came to know that WordPress is storing the widget contents as serialized array! So instead of directly editing via phpmyadmin, I had created a new admin user through phpmyadmin using this awesome tutorial: How to Add an Admin User to the Wordpress Database Then I logged in to the dashboard and made changes to the wid... | Where is the content of widgets stored in mysql table | wordpress |
I build a legal portal in a non-latin language (Greek). I want all my content to be thoroughly indexed by search engines, preferably in Greek. Should I enter my post slugs in Greek? The pages then appear with URLs ending in %20%32%33 etc instead of Greek. Does this affect the page URLs? Will they be properly indexed by... | I will agree with King Li. Furthermore there is a very old plugin you can download from my dropbox that is still functional and will be of great help to you. What it does is changing the greek slugs to latin characters (greeklish) automatically for all new posts/pages/custom posts . You will have to manually change you... | slug: should I use latin characters only? | wordpress |
A site is using "child1" named child theme. When this site switches to other child theme named "child2", their widgets are moving too but theme locations are not moving. How can i auto assign menus to theme locations on theme activation? I found this solution from http://wordpress.org/support/topic/how-to-assign-a-word... | Well, I wrote a solution so writing it here: <code> /* This action copies old theme's theme location saves to new theme if new theme doesnt have saves before. */ add_action( 'after_switch_theme', 'ajx_theme_locations_rescue' ); function ajx_theme_locations_rescue() { // bug report / support: http://www.unsalkorkmaz.com... | Assign Menus to Theme Locations with theme activation | wordpress |
Basically I've used <code> bloginfo(template_url) </code> in a WordPress theme, but when I run theme-checker , it recommends to replace <code> bloginfo(template_url) </code> with <code> get_template_directory_uri() </code> , however when I use <code> get_template_directory_uri() </code> it doesn't work. It works fine i... | <code> bloginfo($option) </code> echos out a value whereas <code> get_template_directory_uri() </code> returns a string - did you maybe forget to echo <code> get_template_directory_uri() </code> ? Also are you passing a string with quotes i.e. <code> bloginfo(template_url) </code> vs <code> bloginfo('template_url') </c... | How to replace bloginfo(template_url) | wordpress |
I am building an RSS reader plugin and I'd like some advice on how to store the data and settings for this plugin. The idea is to be able to enter a set of feed sources and associate each one of these sources with one or more categories. Thus you can have several categories e.g. sports, politics each having their own a... | Add a Custom Post Type called <code> 'feed' </code> Add a Custom Taxonomy for 'feed' called <code> 'feed_category' </code> As you mentioned, use a Custom Post Type for your feed items, for example <code> 'feed_item' </code> When adding an <code> 'feed_item' </code> , add post_meta which makes the link between <code> 'f... | Good way to store content and settings for an RSS plugin | wordpress |
When I've built a few sites for small businesses in the past, I've historically been able to do without anti-spam measures. I now have several sites which get maybe between 5 and 20 spam comments a month each. I have it set set so all comments must be moderated, which isn't a really a big deal. I would call it good eno... | Use Antispam Bee . It is free, doesn’t phone home, and it works surprisingly well as long as you dont change the comment form too much (you have to test it). Just make sure you disable the mail notification for spam comments. :) | How to deal with small scale comment spam on small commercial sites? | wordpress |
I need to display all the months that have active posts, and inside each month I need to display at least 5 posts that are tied to each month.. the HTML will look like this: News items <code> <h6>May</h6> <ul> <li><a href="#">Souvlaki ignitus carborundum</a></li> <li><... | one possibility is to run all posts through the loop and only output the month once per new month: <code> <?php $counter = 0; $ref_month = ''; $monthly = new WP_Query(array('posts_per_page' => -1)); if( $monthly->have_posts() ) : while( $monthly->have_posts() ) : $monthly->the_post(); if( get_the_date('m... | Display all months with posts and inside each month show the 5 latest posts | wordpress |
I am trying to use the Category Posts (WP-CPL) plug-in on a blog I'm working on to filter 'Recent Posts' by category. Basically, when someone clicks on the category name on the blog, I would like it to display the posts from that category. This would be through the 'archives.php' file of the Life Is Simple template. Th... | I found a much easier way to do this. I called this PHP in the Loop: <code> if ($paged == 0) $offset = 0; else $offset = ($paged - 1) * 11; global $post; $category = get_the_category($post->ID); $category = $category[0]->cat_ID; $myposts = get_posts(array('numberposts' => 11, 'offset' => $offset, 'category_... | Using WP Category Lists Plugin to Dynamically Display Category (PHP) | wordpress |
I'm trying to use <code> wp_title() </code> to create a heading for my pages, but I'm using a static front page and, while all of the other pages render the title properly, the front page won't. This is what I'm working with: <code> <div id="main-content"> <h1><?php wp_title("", true); ?></h1> &... | wp_title() is for the html title tags in your websites head section. It's not for outputting a title. Use the_title() , or get_the_title() , | wp_title() empty on a static front page | wordpress |
I really want to use one of the Cache plugins so that I can serve up more Static pages on my WordPress theme/site. This is obviously the best performance upgrade you can do for a WordPress theme/site. There is a few dynamic elements to my theme that have held me back from making the Leap to Static/cached pages. I will ... | So, there are many sub-questions, i'll try to address each. Views Counter Problem - I could make this Value/function be ran using Ajax. Once the new Cached/Static page is loaded, Javascript could then use Ajax to request and update the Views counter for that page. Totally agree: added benefit: loading it via ajax when ... | Best way to show Dynamic Content on a Cached Wordpress Site? | wordpress |
I am using wp_list_categories to return (you guessed it) a list of categories within a custom taxonomy. The <code> orderby </code> parameter accepts sorting by ID, name, slug, count, and term_group. Is there a way that I can custom sort the results? Ideally I could pass an array of category ID's in the desired order, b... | There is an unused column, term_order, in the wp_term_relationships table that you can use to assign a custom order to the terms within your taxonomy. The order is set at 0 by default and it will take a custom query to get the order back and another solution to set the order. Example query: <code> function wpse_order_t... | How can I custom order the results from wp_list_categories? | wordpress |
To use jQuery UI AutoComplete, I loaded the following scripts: <code> wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-position'); wp_enqueue_style( 'jquery-ui-autocomplete', $ul .'/css/jquery-ui-1.8.custom.css' ); wp_register_script('... | WordPress requires no conflict wrappers for jQuery. <code> (function($){ $("#to").autocomplete({ // code... }); })(jQuery); </code> Or: <code> jQuery(function(){ jQuery("#to").autocomplete({ // code... }); }); </code> | jQuery UI AutoComplete not working in wordpress? | wordpress |
Hi I am building a plugin options page. What I'd really like to do is implement repeatable tabs (which I know is possible with the Settings API), but with a twist I haven't seen in any options panel till now. I'd like to create new tabs on the fly, exactly like the 'Menus' section in the admin UI works. Is there any st... | WordPress Tabs are non-standard, static html markup. You can only add the markup within your <code> functions.php </code> theme file or inside your plugin. <code> <h2 class="nav-tab-wrapper"> <a href="#" class="nav-tab">Tab #1</a> <a href="#" class="nav-tab nav-tab-active">Tab #2</a> <a... | Add on the fly tabs to plugin options | wordpress |
I am using the Yoast SEO plugin and I am finding that on my site it is repeating the website title and blog tagline twice. For example, it looks something like this in my browser tab: Example.com | This is my tagline Example.com This is my tagline I have implemented, just as Yoast says, the following code in my header.... | <code> wp_title() </code> is filterable so there could be another plugin or most likely your theme already adding a filter. Have tried checking the force rewrite in the plugin options? If that doesn't work you need to hunt down what else is adding the filter and remove it. If it's your theme look in functions.php for <... | Yoast SEO: title tags are repeating my website name and slogan | wordpress |
When I insert a gallery to a blog post using the <code> [gallery] </code> shortcode or simply the <code> insert media </code> button I get a default structured gallery in my blog through <code> the_content(); </code> However the gallery comes with a lot of inline CSS and other stuff I want to remove, how can I do it? | You can filter the default gallery shortcode. Here is something I've used in the past. <code> add_filter( 'post_gallery', 'wpse_gallery', 10, 2 ); function wpse_gallery() { global $post; /* Orderby */ if ( isset( $attr['orderby'] ) ) : $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ... | How do I change the gallery that is inserted in the post? | wordpress |
How can I get the line breaks that I make in the TinyMCE editor to translate into new lines in the web page. Suddenly all posts when actually previewed on the theme are walls of text. In the final post's source code there are no surrounding <p> elements surrounding the elements. | By default, line breaks in the TinyMCE editor are convered into <code> <p></p> </code> paragraphs. Either your theme or a plugin is disabling this functionality. To figure out which, you need to: Disable all plugins and see if this fixes the problem. If it does, then re-enable your plugins one at a time to ... | How to get line breaks to translate to paragraphs? | wordpress |
I have a WP plugin which uses the request parameter "type" to determine what code-file to load in order to do some processing. The code which handles this is as follows: <code> add_shortcode ('myplugin_frontend_main', 'MyPlugin_user_dispatcher'); function MyPlugin_user_dispatcher ($args=array()) { $type = $_GET['type']... | WordPress will typically filter off query arguments unless you tell it about those arguments and ask it not to. From this older tutorial , you can see how to add a new query variable to WordPress (so it won't get stripped out): <code> add_filter('query_vars', 'parameter_queryvars' ); function parameter_queryvars( $qvar... | Request parameters in $_GET do not match URL called | wordpress |
All in my case I want to get post result by Gender, Age, City etc... I am using this query. If i have any of variable like age, city, gender for that "AND" operation will perform and get only result for that variable. Note: Consider those case also where i have no variable like city but it should work for gender & ... | Here is a modification of your code where you can add the meta query if certain $GET keys are set. <code> $query_array = array('relation' => 'AND'); if(isset($_GET['gender']) && !empty($_GET['gender'])){ $gender = $_GET['gender']; array_push($query_array, array('key' => 'wpcf-gender', 'value' => $gende... | Conditional arguments WP_Query for post custom fields | wordpress |
This is probably a trivia question, but I can't seem to find a simple solution. This is my wp_list_caterories php... <code> <?php wp_list_categories(array( 'orderby' => 'name', 'show_count' => 1, 'title_li' => '' )); ?> </code> This currently outputs this... <code> <li class="cat-item cat-item-1">&... | one possibility - add a filter to functions.php of your theme: <code> add_filter ( 'wp_list_categories', 'span_before_link_list_categories' ); function span_before_link_list_categories( $list ) { $list = str_replace('<a href=','<span>&#124;</span><a href=',$list); return $list; } </code> | Add mark-up after/before link in wp_list_categories | wordpress |
How can I load buddypress ajax without using the template pack plugi n? I had this in a non-buddypress compatible theme's functions.php. <code> include( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' ); function mytheme_enqueue_bp_default_js() { wp_enqueue_script( 'dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp... | This is how I have used the default BP ajax queries/scripts in a custom BuddyPress theme: (gist with code: https://gist.github.com/3154297 ) <code> function bp_custom_include_ajax() { global $bp; require_once( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' ); if ( !is_admin() ) { // Register buttons for the rele... | Buddypress: Load Ajax Without Template Pack | wordpress |
I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: http://upload.wikimedia.org/wikipedia/commons/3/3d/Wordpress_Template_Hierarchy.png | More than an Answer, this is a research and a compilation. Database Description already in Damien answer. A Google search reveals this in WordPress forums: UML documentation of WordPress As far as I know, that's all we have. If you want to write one, I'm sure it'd be welcomed :) ( Ipstenu , referring to the Database De... | Looking for WordPress System Diagrams | wordpress |
I want to store the current time using the update_option and then compare it if the set time was 3 days ago. I want to know in what <code> format </code> I should store the time? and then how can I compare it with current time and find the difference in the days? | You should store the time as a unix time stamp then you can use human_time_diff to compare. <code> echo human_time_diff( get_the_time('U'), current_time('timestamp') ); </code> If the difference is more than 24 hours difference it will return the value in days. | Finding difference in days | wordpress |
I use w3_total_cache plugin. But i can`t understand what is going on sometimes. I have enabled database caching and debug info at the bottom. Sometimes on the main page 90-96 db queries, sometimes 495-501. How can be so different results for the same page with the same parameters? Or how can be so much queries sometime... | Probably some code on your site caches the result of an expensive operation. When the page is cached by W3TC, if on the very same page generation, cache was being regenerated, you will see the actual queries that operation requires. After that, queries are like the usual page load ones. Don't worry about it until you s... | Different sql queries count indicator on the main page | wordpress |
Basically I am using Advanced Custom Fields and have an ajax tabbing system that works with the ACF. The current set up is below: <code> <ul class="css-tabs"> <li><a class="current" href="/wp-content/themes/blue-and-grey/uni-general.php">General</a></li> <li><a href="/wp-content/t... | <code> the_field() </code> takes an optional second parameter of <code> $post_id </code> . If you know the post you want, presumably you can use that to grab the data you need. | Pulling Advanced Custom Fields from other pages | wordpress |
I'm having a little problem where, well long story short, i get told to "fix" a WordPress gallery etc...be it add/remove images or whatever but when i log in and go to that page, be it in "visual" or "HTML" view, there's nothing in the content area. like i don't see anything in there. its blank like if it was a new pag... | Check the page template setting - is it set to default? If not, look at the code for the template itself. I've seen new WP devs manually insert scripts and codes directly into the template rather than enqueue in <code> functions.php </code> . What plugin is being used to manage the gallery? | Wp backend page content not showing, but actual page is fine | wordpress |
Trying to run a query that pulls: get me 4 posts or pages that are not in sticky_posts and have <code> (my_featured_post = 1 AND photo-image_post_id > 0) OR (my_featured_post = 1 AND photo-image_page_id > 0) </code> OR if it's easier to do - somehow saying <code> (my_featured_post = 1) AND (photo-image_page_id>... | I don't think you'll be able to do this in a single query - what you seem to need is multiple relationships between conditions, and as it works currently, meta_query doesn't let you do that. I googled it a bit and found others saying it doesn't, but I also went into the core code and looked at the WP_Meta_Query class. ... | Query by multiple meta elements not seeming to work - wordpress is timing out | wordpress |
Okay so my question is quite simple. I need to implement some custom routing rules for my plugin. Those routes would only take one argument (so nothing complicated) and would look like : http://www.example.org/myroute/myargument And ideally, this would call a custom class, and display a custom template (that could dire... | You need to do 3 important things. Create a custom rewrite rule to turn parts of the uri into values passed to index.php Add <code> myroute </code> and <code> myargument </code> as query vars to wordpress knows they are valid $_GET paramters when the rewrite rules pass something to them Flush the rewrite rules. First, ... | Custom plugin route in Wordpress | wordpress |
I have a query as follows: <code> $wp_query = new WP_Query( 'meta_key' => 'end_date', 'meta_value' => 'today', 'meta_compare' => '>=', 'post_type' => 'vehicle' ); </code> I want to show only those posts of the vehicle post type that have the meta key end_date which contains a date that is later than toda... | First, your date format has to be in descending order from largest to smallest units, i.e.: year, month, day, hour, minute, second, etc., otherwise MySQL can't query or order on the field. In this example I use year - month - day: <code> $today = date( 'Y-m-d' ); $args = array( 'post_type' => 'vehicle', 'meta_query'... | WP_Query() show posts that end later than today | wordpress |
Is there any way to assign custom capabilities to user, I'm NOT talking about User Role. I'm running a multi author blog where I assigned user role of "Author" to all of my authors. But I need a plugin or function.php snippet that remove a capability(not the role) from USER-ID NOTE - I dont want to assign/revoke capabi... | Finally, I've figured out a way to do it using <code> WP_user </code> Class. Snippet to add/remove capability to/from specific user - <code> //to remove capability from user $user = new WP_User( $user_id ); $user->remove_cap( 'can_email'); //to add capability to user $user = new WP_User( $user_id ); $user->add_ca... | How to assign capabilities to user NOT to User Role | wordpress |
On the first page of a specific category, I want WordPress to show 4 posts per page. On the following pages, however, I'd like to have 6 posts per page. I tried using a conditional query (see below), but this completely screwed up the number of posts per page... <code> $paged = (get_query_var('paged')) ? get_query_var(... | One way to do it is use WordPress › Custom Post Limits « WordPress Plugins. That plugin gives options for individual categories, first page and pages, archives and search results without needing custom loops in template files. | Show different number of posts on second page of category | wordpress |
How do I create a column down the right-hand side of my site? I changed a setting on one of the pages some time ago, and on that page I have the result that I'm looking for: On this page: http://richardclunan.com/copywriting-critique/ I have a column on the right. But I've forgotten what setting I changed. For example,... | I can see that you are using the standard Twenty Eleven theme, so all you need to do is go edit the page in question from the admin side, and then if you havent changed the orders of things there, you should have a meta-box with a drop down titled " Template ". Choose the " Sidebar Template " in the drop down and then ... | How do I create a column down the right-hand side of my site? | wordpress |
Sometimes in my posts I use the keywords that exists in my tags and categories list. Is it possible to automatically link the keywords in texts with the tags and categories? Or should do it manually ? I will use this in my SEO practices. Thank you | Here is plugin that will automatically link to tag / category pages if similar keyword is used in the post. -- SEO Smart Links | Autolinking keywords in text with tags | wordpress |
I have a multi-site installation of wordpress currently running, and I am having some problems with user registration. Currently, I use an external authentication plugin (similar to LDAP i guess) and I use this to validate usernames/passwords. For this to work, every user is first added to the Wordpress list of users, ... | There is a plugin for this. It is Network Username Restrictions Override. Please remember to check out the FAQ #2 to know how to allow periods in usernames. Let me quote it here... You'll have to update the regular expressions in your .htaccess file if you use email addresses or periods in site URLs. The default WordPr... | Allowing periods in usernames | wordpress |
I would like to add a check on the following piece of code that shows the arrows next/prev only if the next/prev image exists: <code> <div class="gallery-image"> <p class="attachment"> <img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[... | The <code> previous_image_link() </code> only prints something if the there is a previous image. Similarly for <code> next_image_link() </code> . The problem is that you're styling the containing <code> span </code> element - which always exists. Instead you should style the <code> a </code> tag inside the <code> span ... | Pagination between images (active/inactive) | wordpress |
I use a theme to build an portfolio. I´d like to add an pinterest "pin-it button" into the fuctions.php: Facebook, Google+ an Twitter were done, just the pinterest won´t work. Can´t found the the wrong code. This ist my code: <code> function share_this($content){ if ( is_singular( 'portfolio' ) ) { $content .= '<div... | There were several errors in your code. The biggest was that the function didn't even have a closing bracket, but we can probably assume that was just not copied into your post, otherwise nothing would have been working for you. This is a filter on the content right? It looks like you want to append these shares after ... | Pinterest Integration Using functions.php | wordpress |
The first admin of my site has a full Visual Editor with style sheets. I create new users who are admins (their profile page has same settings with original admin) but they cannot set the style of paragrpaphs (no drop-down list with styles). Any ideas? Thanks. | First of all Check If you disabled the visual editor from your profile page. [See the Screen Shot] You ned to uncheck the box - Visual Editor, the option is located in User's Edit Profile Page. UPDATE - 1 2 - You might have been disabled the Kitchen Sink, To enable it Click on small button available in visual editor (R... | Visual Editor: Paragraph styles appear to one admin but not to others | wordpress |
My wordpress is updated to latest version 3.4.1 and I noticed a strange function of it - in the Page attributes block page template dropdown has the value: <code> (.*)\n)siU",$template_contents,$template_name) </code> Whay this is happening and how to get rid of that? | Here is another similar thread that have been resolved now.. stackexchange-url ("get name of the current template file") Take a look.. | Strange Behavior of Page Template Dropdown | wordpress |
is there an easy way to set up a single wordpress intallation to serve its pages both over http and https? I have an http based website, and I have some pages that I would like to make accessible as facebook pages too. But facebook requires https, and I would prefer to stay with https for normal requests. Do you know a... | When you setup the SSL certificate for your domain on your web server, your WordPress site will immediately be accessible via <code> http / https </code> connections without any extra configuration. Any configuration is required when you want your website or its backend ( <code> wp-admin </code> / <code> wp-login.php <... | how to server over http and https with one installation | wordpress |
How would I adjust the following code to only show the image tag when there is a variable present in the "imageembed" field? <code> <?php $imageid = get_post_meta($post->ID, 'imageembed', true); ?> <div class="newsimage"><img src="<?php echo wp_get_attachment_url( $imageid ); ?>" width="640" /&g... | <code> <?php if (strlen($imageid = get_post_meta($post->ID, 'imageembed', true))) { ?> <div class="newsimage"><img src="<?php echo wp_get_attachment_url((int) $imageid); ?>" width="640" /></div> <?php } ?> </code> | Only show image from custom field when present | wordpress |
I've got a site with the following structure: About Page 1 Page 2 Page 3 Page 3.1 Page 3.2 So Page 1, Page 2,... are subpages of the About page. I would like to have a sidebar that lists the pages, but only shows the subpages when needed. So when I'm on Page 1, I need to see: Page 1 Page 2 Page 3 And when I'm on Page 3... | Here is a function that im using for submenus, maybe there is a better way to do this but i always ends up with this solution. Add this function to your theme functions.php file: <code> function wpse_submenu( $id, $echo = false, $showParent = true, $depth = 0 ) { global $wpdb, $post, $before, $page_for_posts; // if is ... | List subpage of subpage | wordpress |
I'm a Drupal dev, getting into Wordpress. So far as I can tell there are a few different methods by which a plugin can output content on to a Wordpress site: Shortcode Rewrite API Widget API "Template tag" (ie instructing themers to call a PHP function from your plugin in their theme) Actions API Which do you use and w... | This highly depends on what you need. General answer on the question The Rewrite API basically does all the URl rewrite stuff. The Shortcode API is meant to be an easy to use extension approach for people who want to extend their posts/content with the text/html editor. As an alternative, you also/extend use the quickt... | When to use which plugin output method? | wordpress |
I'm trying to resolve a problem i have showing category posts. I have added a category to my main menu, eventhough it has posts - in the basic theme it doesn't show, in my theme - it shows as a link but when i click on it, shows just a blank page. I tried resetting the permalinks, clearing the cache... nothing. Does an... | yes i tried both. it was still hapenning. at the end i discovered it was an error coming from the index.php - one line of code i had added following a tutorial which i forgot to remove after. removing it brought everything back to normal. sorry to bother, but it might help someone else. | not empty categories don't show in menu | wordpress |
so this is sort of a continuation of another question that I had to ask recently. I wanted to start another conversation, since technically my last question was answered. The last question is here: stackexchange-url ("Display Post Thumbnail Without Being Featured Image") if you would like to get caught up on where I wa... | Modify your function as such: <code> // This theme displays custom size (page-single) featured image on the Post's page function InsertFeaturedImage($content) { global $post; $original_content = $content; if ( current_theme_supports( 'post-thumbnails' ) ) { if ((is_page()) || (is_single())) { $content = get_the_image( ... | How to display a post's Featured Image with this code? | wordpress |
Do I need to implement an editor-specific stylesheet for the WordPress WYSIWYG? In doing so will this eliminate style conflicts that I am currently experiencing?I am have not implemented an editor stylesheet so I am noticing that it is becoming very difficult to separate surrounding website styles and editor styles. Wh... | The WordPress editor shouldn't be pulling in the themes CSS files unless you have a file that is named <code> editor-style.css </code> . You can either use the editor-style.css and simply place it in your themes root directory, add certain styles to the stylesheet (not all the theme div and id tags will apply to the Wo... | How do I separate my theme's styles from editor styles? | wordpress |
I'm writing my first Wordpress plugin which will be a newsletter-type plugin. It'll continuously add members who fill out a form to a database table that keeps track of the following: cell ID Time MemberName MemberEmail. When I send out the email to the newsletter participants, I want to send it using SMTP. Is there a ... | If you store the password in the PHP, it will be accessible to anyone who has the PHP (i.e. anyone who has the plugin). If you store it in the database, it will be accessible to anyone who has direct access to the database (i.e. anyone who installs the plugin and knows how to use phpMyAdmin). However, to store a simple... | Storing a password for use with a Wordpress plugin | wordpress |
So, like the title says, I'd like a single function to get an aggregate list of all custom fields, site-wide (all posts, pages, CPT's). Normally, I do this with a couple SQL statements and juggle the results, but I was wondering if anyone's come up with a more core-oriented way of doing this. Mostly, though, I wanted s... | The function below will store a distinct list of all custom fields for the list of posts/pages/custom posts that is passed to it in the keys of the array <code> $customfields </code> . The array values are the number of posts with the corresponding field. In the example, custom fields added by plugins are excluded ( <c... | Get aggregate list of all custom fields for entire blog | wordpress |
All I want those post having post_type == profile And wpcf-gender == 1 (male). I tried this code <code> $wp_query = new WP_Query( array( 'meta_key' => 'wpcf-gender', 'meta_value' => '1', 'meta_compare' => '==', 'post_type' => 'profile','posts_per_page' => 2 ) ); </code> Results which I am getting is perf... | you need to add global $paged and then in your array that is being passed to WP_Query you need to add 'paged' => $paged <code> global $paged; $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query( array( 'meta_key' => 'wpcf-gender', 'meta_value' => '1', 'meta_compare' => '==', 'post_type' => 'profil... | Pagination is not working wp_query custom fields values | wordpress |
How does one apply an action to one particular page within admin? I've added a bunch of wysiwyg editors to one page ("Home") and now I don't need the main editor. But the function below - of course - removes the editor from all pages: <code> function remove_editor_from_home_page() { remove_post_type_support( 'page', 'e... | <code> add_action( 'add_meta_boxes_page', 'wpse_57924_remove_editor' ); function wpse_57924_remove_editor( $post ) { if ( $post->ID == get_option( 'page_on_front' ) /* or hardcode ID if not front page */ ) remove_post_type_support( 'page', 'editor' ); } </code> | How to select a page within admin? | wordpress |
I some posts I have a lot of revisions, and I want only 2 revisions for each post. I found this plugin http://wordpress.org/extend/plugins/revision-control/ that able to set that in the future WP will not store more then 2 revisions, but It does not remove existing revisions. I found this plugin http://wordpress.org/ex... | You can use <code> define ('WP_POST_REVISIONS', 2); </code> in wp-config.php for two revisions, and you could turn that into your own plugin. Manully remove all revisions with this query run in phpmyadmin: DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON ... | How to reduce the number of revisions? | wordpress |
This is similar to this question: stackexchange-url ("How to change a custom query into a standard loop?") - but I want to do this while writing a plugin, not writing a theme. I need to be able to run a custom query (using regular old sql), and set the result as the post available for the loop. I am writing a plugin, s... | Found the correct hook to use. This intercepts the query and lets me modify it for my own purposes: <code> add_filter('posts_request', 'changeQuery'); function changeQuery($query) { $query = 'my new sql query here'; return $query; } </code> | Pass results of custom query to loop - when writing a plugin | wordpress |
I'm looking for a way to query posts by id, and using a string as a parameter, instead of an array. Like this: query_posts('p=153'); But I need to get multiple posts. For example with ID 153 and 154. How would I do that with a string as a parameter? The reason that I'm using a string is because I'm generating that stri... | You could convert the string to an array using the php explode function . So if you used a comma as your delimiter, you could pass the string <code> '153,154,87' </code> and that would and then use the explode function to convert it to <code> array( [0]=>'153' [1]=>'154' [2]=>'87' ) </code> If you want to keep... | query multiple posts by id using a string parameter, not array() | wordpress |
I have two custom rewrite rules; after reading allot of great posts here I found a way to make them work. The question is this: Is there a way to merge this code? I'm not sure that the way I wrote it is optimal: In my functions.php I have the code of the 1st rule: <code> add_action('init', 'rewrite_cat'); // Rewrite Ca... | This is the working code: <code> add_action('init', 'rewrite_init'); // Rewrite add_action('query_vars', 'rewrite_query_vars'); add_filter('template_include', 'rewrite_template_include'); function rewrite_init(){ add_rewrite_rule('([^/]+)/([0-9]+)/?$', 'index.php?catname=$matches[1]&currentpage=$matches[2]', 'top')... | Optimal code for two add_rewrite_rule's | wordpress |
I'm attempting to add a <code> Back to Search Results </code> link which in essence will simply link back to the starting search page - for example <code> /?s=test </code> . I've taken a look at the global query vars and do see there is a <code> paged </code> query argument available -- which does do the job when the p... | http://codex.wordpress.org/Function_Reference/get_search_link was what I was looking for. | remove_query_arg() on rewrite rule | wordpress |
I currently have a custom post type of "Faculty" - each faculty can have zero or many custom post type "Bibliographies," and a bibliography can belong to one or more faculty. What is the best practice for setting up this association, and more importantly, is this possible still using the API? I'm testing this with 3.4.... | When its about setting up Post to Post relations, I find the scribu's Posts 2 Posts plugin the best out there. the plugin not only does provide the interface but also provides the API to handle the relations. | Custom Post-to-Post with multiple parents? | wordpress |
Im currently administering close to 20 separate wordpress installs and now Im at the point where I need to work out a plan going forward. As a sole operator, I just haven't had the chance to invest in this prior to now. What Im considering is two approaches. 1) Run Wordpress in a Multi-site configuration. In this setup... | As awesome as MultiSite can be, it's certainly not always the answer to this situation. A first glance, you have the advantages of: One install (easy to upgrade) Easy to manage (with the help of the single sign-on plugin) Plugins & themes are shared - again, easy to maintain & upgrade But in retrospect, these c... | Best architecture for multiple websites | wordpress |
I'd like to use the excellent Zoninator plugin with my theme, making it a required plugin using the TGM Plugin Activation Class . On activation of the plugin I want to create one or more zones programmatically. Can anyone tell me how to Set a listener in my theme which performs a function when a particular plugin is ac... | As advised by the Zoninator developer Mohammad Jangda, you can solve the second part of this problem like this: <code> if (z_get_zone(‘home’) == ”) { global $zoninator; $zoninator->insert_zone( ‘home’, ‘Home’, array(‘description’ => ‘This is the Home Zone programmatically inserted’)); } </code> | Zoninator zone manager plugin - get and set zones programmatically | wordpress |
this is the code i am using to call wp_nav_menu <code> <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => '', 'menu_id' => 6, 'depth' => 4 ) ); ?> </code> the menu appears perfect on home page and single post pages, as seen here: http://www.enkitec.com/ but when i visit ... | Don't call Nav Menus by <code> menu_id </code> . Rather, define an explicit <code> theme_location </code> for each place in your Theme template at which you want to include a Nav Menu, and then use that <code> theme_location </code> as the parameter passed to <code> wp_nav_menu() </code> . In this case, you've defined ... | wp_nav_menu not appearing correctly on category page | wordpress |
In the WP editor there is a full screen button. It has shortcut <code> ALT+SHIFT+G </code> . When the button is pressed it shows a different full screen editor then when the shortcut is used. I tried this on multiple 3.4.1 installations, one of them had no plugins to interfere. Why is this? EDIT its a bug: http://core.... | It's a bug http://core.trac.wordpress.org/ticket/21197 Using the shortcut pulls up the TinyMCE fullscreen editor rather than the custom wordpress fullscreen editor. Update 13. July 2012: Fixed in Changeset 21266 . | Why are there two diffrent full screen editors? | wordpress |
I have a site that uses a custom query to filter posts: <code> <?php //Search Region table to retrieve array of country names $regionresult = mysql_query("SELECT * FROM gallery_regions WHERE region='$region'") or die(mysql_error()); $num_rows = mysql_num_rows($regionresult); // Process search reults and format array... | You need to set <code> paged </code> or an <code> offset </code> in your query, otherwise you're always fetching the same 48 posts. <code> $page = (get_query_var('page')) ? get_query_var('page') : 1; $args = array( 'paged' => $page, 'posts_per_page' => '48', 'cat' => '4', 'meta_query' => array( array( 'key'... | Custom Query Not Paginating | wordpress |
Lets say i have 100 posts. And i would like to lowercase the title. but only 70 of it. I cant use text-transform or mb_strtolower. Is there anyway to download posts and lowercase the title with microsoft word and reupload it? | Assuming this question is related to Wordpress, here is answer :- You can update the titles directly into your mySQL database using simple update function. one of my user publishs all his posts uppercase (title) i want to edit them and make it normal. – Using some conditional statements as I mentioned in this code, you... | Changing title to lowercase | wordpress |
Is it possible to create a loop that goes through all the available custom post types without statically defining what those custom post types are, and then displaying the featured image of the first post for each of those custom post types? | This should work for you: <code> // grab all public post types $post_types = get_post_types( array('public' => true), 'names' ); // loops through each post type foreach( $post_types as $type ) { // setup the query $query_args = array( 'post_type' => $type, 'posts_per_page' => 1 ); // perform the query $items =... | Loop that displays the first post of every available custom post type? | wordpress |
I'm new to WordPress and I was going through skills sets on some of the projects that are to be built in WordPress. The prerequisties that were mentioned are listed as below: HTML (obvious) CSS (that too is obvious!!!) PHP - Is this required to learn WordPress? Moreover, Is there any other skill set that is required to... | Other skills include, Being a ninja. But aside from that you pretty much summarized the core basics of what you need to familiarize yourself with to learn and develop with the WordPress platform. HTML CSS PHP jQuery/JavaScript Are what make up the foundation of WordPress itself. How far you want to go with each of thos... | Prerequisites Skills to learn WordPress | wordpress |
Is it possible to have a drop down menu like youtube/demonoid that allows you to sort your index (and caterogy.php) blog posts by date/popularity/viewed)? I seen plugins for adding most popular widgets or pages, but I was hoping to be able to sort the users page they are looking at (be it the index page or a specific c... | Yes, we can sort Wordpress posts in different orders, You can do following sorts without installing plugins. sort post by date ( ascending / descending ) Sort post by title (ascending / descending ) Sort post by comment count ( ascending / descending ) -- These are just basic we can do even more using categories and ta... | Drop down+sort blog posts date added/most popular | wordpress |
I'm lost, I don't understand why this works <code> http://website.com/?tag=my-cat-slug </code> and not this <code> http://website.com/?tag=15 </code> It's really annoying because <code> wp_dropdown_categories() </code> only provides ids as values. I tried to change permalinks to default settings instead of rewriting: <... | Because the <code> tag </code> query variable expects the value to the terms slug. It'll be looking for the term with slug '15' (which presumably doesn't exist). And, yes its quite frustrating that <code> wp_dropdown_categories() </code> uses the ID as the value, rather than the slug. This is because it was originally ... | Why id in urls doesn't work and slug yes? | wordpress |
Probably pretty simple and more PHP-related than pure WP, but how would one pass the <code> $page_id </code> generated in the first code snip into the <code> new WP_Query () </code> in the second code snip? What I need to do - in a page template - is dynamically get the current page ID and pass that to the new WP_Query... | If you're on the same page and you just need to display the same page's content again, you can just call <code> the_content </code> multiple times. To answer your question, however: You'll use the <code> page_id </code> argument for WP_Query (you could also probably use <code> p </code> ). You can even remove your <cod... | Pass $page_id to new WP_Query | wordpress |
I've been given a design for a WordPress site which will be mostly made up of pages rather than posts. However, at the top of each page there needs to be three featured items in a row. Each featured item will have an image, title, a small bit of summary text, and a link to another page. Can anyone tell me the best way ... | Since I don't know the complete scope of the project I can only give a suggestion on what I would do. Since you will be using a page for placing the 3 images with title and excerpt, I'd create a custom page template that has two loops. The first loop would use <code> query_posts </code> to bring in the 3 images (title,... | templates with page teasers Or Featured Items | wordpress |
I have a page on my website called Work (that uses a work.php page template) set up as my front page, where I would like to display a list of the last ten posts with the custom type called portfolio. Here is my code so far: <code> <?php $the_query = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page... | Find the code where you register your portfolio post type and add/change this arguments: <code> 'has_archive' => 'work', //under work you will see a list of portfolio items 'rewrite' => array( 'slug' =>'work_item', 'with_front' => false, ), </code> then manually go to Settings > Permalinks and refresh your ... | Custom Post Type conflicting with page? | wordpress |
When save a term which is a child term, if I don't provide specific parent id, will WP make this term's parent 0 ? | When you create a term for a hierarchical taxonomy, if you don't specify a parent, its parent ID is set to 0. In other words, it becomes a parent term. Edited with regards to comments: Add specifically each term you wish to add to the post (parent terms aren't automatically added if their children are). Adding terms to... | Do I have to set parent when set post term? | wordpress |
Live site. I've got a custom theme that is giving me slight issues with shortcodes- they don't work. When I switched back to the default theme, the shortcodes worked fine. What do I need to look for in my custom theme to be the culprit? If it matters, the shortcodes are for Contact Form 7 and Bookings plugins. contact.... | Your problem is the loop itself. As others suspected, you don't have <code> the_content() </code> to display the page content. Change your loop to this and that should fix your problem: <code> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php endwhile; else... | plugin shortcodes not working on custom theme- unsure how to fix | wordpress |
I don't know if my question is clear. I want to add and remove some options in the circled section of the image. thanks. | I believe you might be talking about adding <code> plugin_action_links </code> such as, <code> Settings | Deactivate | Delete | Visit Site </code> As seen on the Plugin management page for all plugins. I was going to take an example from one of my plugins however here is an example that's much simpler to follow from Pi... | is there a way I can add or remove some plugin options? | wordpress |
What experiences have you had with MarketPress vs. other WP ecommerce solutions? I found a client that wants to use it and I never worked with it before. How does it compare with WooCommerce or WP e-Commerce? Or does anyone know of a good and recent comparison of WordPress ecommerce solutions? ...everything I find on t... | Questions like this is are not really suitable for WPSE because they attract a lot of subjective, open ended opinion, for which there is often no right answer. Let me give you a real world example. I have used several WordPress E-commerce plugins, both free and premium types, I've also created my own custom solutions i... | MarketPress vs. other WP ecommerce solutions | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.