question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
When I try to insert a map into my WordPress page, I get only a gray-colored field with some controls as shown on the picture: No matter, how I put in into the page: by using a special plugin or with my own java-code. I use WordPress 3.2.1 and I've tryed Google Maps for WordPress version 1.0.3 and Yandex Maps for Wordp... | These errors come from CSS rules from your WordPress theme that are also applied to elements on the map. For example, on your page, I was able to fix the popup by disabling the <code> #content table </code> and <code> #content tr th </code> rules which add extra margins. In a test setup I even got gray gaps between the... | Google Maps and Yandex Maps doesn't work correctly | wordpress |
This is more of a PHP question than a WordPress one. I have a custom post type event that by default outputs the date as "September 11, 2011 9:00 am" format. I'm trying to format the post in http://schema.org/Event format, I have converted every other part of the post to that format (place,address, etc) except the date... | Use <code> the_time </code> or <code> get_the_time </code> , which accept the same format parameters as php's <code> date </code> . <code> // assign to a variable $iso8601_date = get_the_time('c'); // or output directly the_time('c'); </code> EDIT- converting formats with php: <code> $date = "September 11, 2011 9:00 am... | Convert a date to ISO8601 date format | wordpress |
[Found the answer (please scroll down to Edit2]: I'm trying to implement Scrollable into my theme. I ran into a few problems. I don't know much about javascript, but as people here encouraged me to try as it's very well documented, I gave it a try. Now, I need your help. I want several instances, but with my current se... | Look at the <code> next </code> and <code> prev </code> configuration options in the scrollable docs, I believe they have to be unique between scrollers. | jQuery UI Tools: Scrollable: More than 1 instance possible? | wordpress |
Was just wondering how I would modify this piece of code: <code> <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->parent; ?> </code> ...to display the parent name, rather than just an integer? Currently it returns the ID. Thanks. | <code> <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $parent = get_term_by( 'id', $term->parent, get_query_var( 'taxonomy' ) ); if($parent): echo $parent->name; endif; ?> </code> | Taxonomy Parent Name | wordpress |
Is it possible to add this filter <code> add_filter("the_content", "magicalender_get_event_page"); </code> But only for one specific page, for example <code> if($post->post_name == "magicalenderpage") </code> If I put the if statement inside the function, then on any other pages the content isn't displayed - and wit... | It is helpful to post your entire filter and callback code, rather than just pieces. But, I suspect that the problem is that you're not returning <code> $the_content </code> outside of your conditional, e.g.: <code> function magicalendar_get_event_page( $content ) { if ( $post->post_name == 'magicalendarpage' ) { //... | add_filter for specific pages | wordpress |
I'm currently working on a site which requires a business directory for 80 tennants. In an ideal world I'd like the administrator to create a user for each business and a page in a custom post type. The user would then be restricted to editing and updating only that page. On the front end these posts would be listed on... | I've seen Role Manager used to restrict editor access only to pages on which they have been designated as authors. Would guess it would work with custom post types. | Giving users an editable homepage/business directory | wordpress |
I am having a weird problem. Every few days I go to my website and get an "Internal Server Error" - Or 500 error. I go into the .htaccess file of the site and notice it's been altered. One character is added at the end of the file. It's easy to fix and continue on, but it keeps happening. htaccess permissions are 644 a... | Assuming you're on Linux, if you go to your wp-content/plugins folder and run <code> grep -R 'htaccess' * </code> it should let you know if any plugins are addressing that file by name | .htaccess and 500 error, extra character added | wordpress |
I have a client who has a WordPress website, and he want to extend it to add new functionalities. These functionalities are included in a website I have already done (a kind of search engine over a database, with some filters), and which is under new enhancements. What I'm planning to do is to create a json api of my w... | A short primer on WordPress development that might help or might confuse you: The main thing to keep in mind: it's all just PHP. And also: don't edit the core files of WordPress, because you will get in trouble when you update to a newer version later. The only code you should edit is that of plugins and of themes. If ... | Consuming an external API in WordPress? | wordpress |
I'm looking for a way to modify all posts of a certain category to be "no comments allowed" without going into each post settings, one by one, and modifying manually. Perhaps a MySQL statement? Thanks | On your posts screen, you should be able to filter by category and then select all and bulk edit to turn off comments. Edit: Bulk actions only apply per page (e.g. 20 posts or however many you have showing), so you'll either have to do it for each page of results or go up to screen options and increase the number of it... | modify all posts of a category to "no comments allowed" | wordpress |
I created a page so that it would appear in my navigation menu. This page would however be my posts page (i.e. all posts would go here) and would also be my front page. I am unable to find anything other than editing the 'Home' in the theme file (none of the themes I tried had the 'Home' editable). In other words, I'm ... | You should be able to do this with just having the front page show blog posts like it does by default. No need to make empty pages and redirect and all that. In the theme file that contains your navigation (quite likely <code> header.php </code> ), look for something that looks like this: <code> <ul> <?php wp_... | Redirecting posts in Wordpress to a specific page | wordpress |
I've found a really promising stats plugin, Open Web Analytics . It has everything I need, also, it is self-hosted, without tracking cookies. The only thing I'm getting worried about is the overhead both in performance both in database size. Does anyone have experience with this plugin? | I hadn't used this specific solution, but any self-hosted analytics in general should be considered potentially huge resource hog: every async action in WordPress is effectively another WP core load, so if tracking code makes even one additional async request to back-end it effectively doubles the load; stat logging by... | WordPress stats: OWA plugin overhead in the future | wordpress |
I've searched WP Codex and StackExchange and gotten some clues, but I can't get this query working. I have 2 custom fields associated with each exhibition in Y-m-d format: exstart-date being the start date of the exhibition and exend-date being the ending date. I can easily display upcoming exhibits and past exhibits, ... | Here is the code I ended up with that works. I should have mentioned that the query was inside the loop, because when I showed it to Damian Taggart of Mindshare Studios, he noticed that he said I should be using WP_Query instead of query_posts. Thanks to Milo and others for attempting to help me without having all the ... | Querying custom post type with 2 custom fields (date-range) | wordpress |
As great as the jQuery Tools might be they're giving me a headache. I want something like this for my website. I have the necessary script included (and Scrollable works just fine btw.): <code> <script src="http://cdn.jquerytools.org/1.2.5/tiny/jquery.tools.min.js"></script> </code> I followed the minimal s... | If it doesn't work anyway, what is the harm of trying to do it right way? You do not use <code> wp_enqueue_script() </code> for most of scripts. You should. Loading two copies of jQuery is wrong. The fact that trying to fix it breaks something does not make it less wrong. From quick look you have a lot of inline JavaSc... | jQuery UI Tools (Flowplayer) Issues | wordpress |
Is it usual or beneficial to have a non-feedburner feed on the site? At the moment I have only a feedburner feed. My blog is WordPress with a custom template. Which of these links would I use to create a Feed?: http://blog.wordfruit.com/?feed=rss http://blog.wordfruit.com/?feed=rss2 http://blog.wordfruit.com/?feed=rdf ... | To make the choice for users as simple as possible, I recommend using only one feed link. Even I am always confused when having to choose between RSS, RSS 2.0 and Atom. Are there still readers out there that don't understand all three different formats? Whether it links to FeedBurner or not depends on your personal pre... | Is it usual to have a non-Feedburner feed on a WordPress blog? | wordpress |
Maybe this is a stupid question. When a user logins to my Wordpress site with the Subscriber role, they have the WP Admin Bar appearing at the top of the page. The user can go into their dashboard and turn this off themselves. But how can I turn this off by default for all existing and new users? | <code> function disable_admin_bar_for_subscribers(){ if ( is_user_logged_in() ): global $current_user; if( !empty( $current_user->caps['subscriber'] ) ): add_filter('show_admin_bar', '__return_false'); endif; endif; } add_action('init', 'disable_admin_bar_for_subscribers', 9); </code> | How do I turn off the Admin Bar for all Subscribers? | wordpress |
Every tutorial I've seen on this subject is out of date, so I'm hoping someone here can help me. I want to style my wp-login.php page with a CSS file. But I'd like to do it in a way that won't get overwritten when Wordpress is updated. From what I can tell, based on the tuts I've read, the best way it to add it using a... | "Headers already sent" means that some code tried to set a HTTP header (eg. to set a cookie), but that PHP already sent content that will end up in the HTML page. The most likely cause is that you added extra newlines after the <code> ?> </code> closing tag when you edited <code> config.php </code> or <code> functio... | "Headers already sent" while trying to add a CSS file to my login page? | wordpress |
here's another stumper. I have a tag.php page. It works fine, unless you click a tag that is in a post associated with a custom post type. Then it doesn't work. Its like that tag, doesn't exist. But its just a tag that's used cross site. I'm not too sure why? And the codex isn't helping much after a lot of searching. a... | If this is related to your other question, what you've got is a custom taxonomy , so you need either a <code> taxonomy-{taxonomy}.php </code> template (in your case <code> taxonomy-article_topics.php </code> ), or just a more general <code> taxonomy.php </code> template. (also, go back and accept answers to your other ... | tag.php doesn't work with tags on a custom post type post? | wordpress |
I must be a bit slow, I still have problems with the position field in the Posts-2-Posts plugin. If I set a position to each connection in a given post (say 1, 2 and 3) I don't understand how to display these connections in this order. I thought this would do the job : <code> $xxx = new WP_Query( array( 'post_type' =&g... | Yes, it was actually 'connected_orderby' instead of 'p2p_orderby'. Also, this can be done via drag-and-drop since version 0.9: https://github.com/scribu/wp-posts-to-posts/wiki/Connection-ordering | Plugin Posts 2 Posts : problems with the 'position' field | wordpress |
I would like to remove the default sidebar from my template, it is not needed and I do not want to confuse the user that will be using the admin panel. I have created my own sidebars that are a bit more descriptive to hold content throughout the site. | If you mean the default WordPress Widgets, you would add this to the functions.php file: <code> <?php // unregister all default WP Widgets function unregister_default_wp_widgets() { unregister_widget('WP_Widget_Pages'); unregister_widget('WP_Widget_Calendar'); unregister_widget('WP_Widget_Archives'); unregister_widg... | Removing the default sidebar from admin panel | wordpress |
How do I go about translating custom taxonomy terms? I am essentially trying to allow authors to see the terms in English and let the subscribers see the terms in Spanish. I am not running a multilingual site in the sense that posts and such are translated, so plugins like qTranslate don't address my need. The closest ... | I haven't tried this myself but theoretically it should work. It just requires some hacking. First of all, this involves using qTranslate . If you don't want a multilingual site, you can always fill only the default language. Then to force display only the default language on the post pages, you will need to modify the... | Translating a custom taxonomy | wordpress |
hi everyone please help me to understand the hook functions <code> wp_header() </code> and <code> wp_footer() </code> What does it mean hook functions and what to do | The Codex is a good place to start: <code> wp_head </code> and <code> wp_footer </code> the <code> wp_head() </code> function call goes in the head section of your theme template, and simply does all of the actions hooked to it. If you look in <code> /wp-includes/default-filters.php </code> , you'll see all of the defa... | Help me to understand wp_header() and wp_footer() functions | wordpress |
Hi and thanks in advance for reading this long question. I'm about halfway through building a site for a NYT bestselling author, and have hit a point where I realize I may not have organized myself in the best way in terms of data management. Before I go back and rebuild, I figured I should ask the experts their opinio... | Well this is a bit difficult to get my head around but some advice: Map out your relationships visually and spent time on it, getting things right at the start is crucial to avoid major problems down the road. Some tools you can use are Visio (Microsoft) or Gliffy, I'm sure there are plenty of others. Secondly I think ... | Should I change these content meta types before building complex archive page? | wordpress |
I have a website that has a news section which simply shows the most recent 6 posts with a category of news. The problem is that whenever you create a post, Wordpress automatically creates a page for that post. The client claims Google does not like it when you have content showing up on a news section as well as on us... | As per comments see Custom Post Types in Codex. Essentially: posts are posts of <code> post </code> type; pages are posts of <code> page </code> type; you can register your own custom types to use for your specific needs. | User friendly news section in Wordpress without using posts | wordpress |
On a theme I'm working on I want a div which expands to 100% height of the outer div (which I will put around the thumbnail). The purpose of this is to move text further to the right to be aligned as a block paragraph and not wrap around the thumbnail. I would use padding but I want the excerpt's text to be aligned to ... | Hopefully I'm understanding what you want correctly. I think you are going to need to wrap the content itself in a div called something like <code> excerpt_content </code> and make that an inline block that's aligned to the top. Then you can use the <code> has_post_thumbnail() </code> as a conditional to assign it anot... | Excerpt Problems | wordpress |
For Microkids related post plugin He said "Using the get_post() function you could get any data you need from the related posts." and he posted this snippet of code. <code> $related_posts = MRP_get_related_posts( $post_id ); </code> I'm not exactly sure how to use the get_post feature for this situation. I would like t... | possibly: <code> $related_posts = MRP_get_related_posts( $post->ID ); if( $related_posts ) foreach( $related_posts as $key=>$value ) { //only holds the following information: //echo $key; //the related_post_id //echo $value; //the related post title echo get_the_title($key); echo get_the_post_thumbnail($key); } <... | Trouble using get_post | wordpress |
I have a multisite wordpress installation with 5 sites, and within each site there are the same 4 custom post type, I want to query the latest 5 posts across all sites where the <code> post_type </code> is <code> gallery </code> is it possible to get <code> wp_query() </code> to pull across all blogs within the site in... | Yes but not in a single query, e.g.: <code> if(is_multisite()){ global $wpdb; $blogs = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1'")); if(!empty($blogs)){ ?><?php foreach($blogs as $blog){ switch_to_blog($blog->blog... | How do I query all posts of one type across my multisite installation? | wordpress |
When creating plug-ins for WordPress, there are times when you need to make a settings panel. Sometimes, you need more than one page, and they can be quite complicated. So far, I have been programming/coding them alone. I try to make most of the WordPress original Admin design, but for sophisticated panels, I get a spa... | There are indeed some frameworks WP Alchemy Rilwis Meta Box Class etc... google will lead your way, as well as the in site search for both packages. | Plugin settings page template | wordpress |
I am writing a custom app for a client that is based on BuddyPress and WordPress. One of the requirements is a custom registration form. To accomplish this, I have managed to hack a custom register.php together inside of a child theme which does the trick. The part where I am stuck, however, is getting BP to save my cu... | Without hacking core files your only option is to use <code> user_register </code> hook to save the custom fields and usually custom fields should be stored in the corresponding object meta table, meaning that if its user meta then store it in the <code> usermeta </code> table and if its post meta then store it in the ... | Saving Custom Fields Defined in BuddyPress' register.php | wordpress |
so I am trying to use the category.php to do all this, and basically I have 3 main/parent categories, Dream it. Build it. Get The Hell Out. and will have many sub-categories under them. What im trying to do is display the title / and related image etc of the parent category through-out the parent and sub-categories so ... | If you have a single level of subcategories under your main categories, you can just do this: <code> $category = get_category( $cat ); if( $category->category_parent ): $parent = get_cat_name( $category->category_parent ); echo '<h1>' . $parent . '</h1>'; else: echo '<h1>' . $category->cat_na... | How to get sub-categories to display same look as there parents | wordpress |
I'm using a custom post type entry to represent each person in an About Us page. When going to the About Us page, it displays the people in a side menu and if the user clicks on a person's name, it goes to a page about that particular person. My client wants to be able to order the people in the side menu. Is there a g... | Take a look at <code> Post Types Order </code> plugin which lets you Order Post Types Objects (posts, pages, custom post types) using a Drag and Drop Sortable JavaScript capability | Plugin or method of allowing user to rearrange custom post types with drag and drop? | wordpress |
There are functions for <code> is_home() </code> , <code> is_blog() </code> <code> is_single() </code> etc... What's the best way to tell if I'm on a page that is requesting that I login? I guess that would just be the wp-login.php page. | Paste this function in your functions.php or a plugin file: <code> function is_login_page() { return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')); } </code> and then you can use it like this: <code> if(is_login_page()){ //this is a login page }else{ //not the page you are looking for } </code... | How can I tell if I'm on a login page? | wordpress |
I'm trying to write a function that will output a set of posts on a page. Because I want to display more than just the post titles, <code> wp_get_archives() </code> won't do (I think). The function to add the post list parses the page meta to find out what kind of list it's supposed to output. Then it runs a query for ... | I'm not sure I have enough info for this to work as you expect. I can tell you that what you are using won't work for a few, regardless of the filters you use. First error: You are using brackets that aren't closed Second, you are using if have posts... but then you reset it at the very end of the code. Here is what I'... | output custom Posts on a Page | wordpress |
I have a site where a user can insert slideshows into a post by entering the shortcode in the content box. He can also add videos by adding the video code in the same box. I need to separate these two shortcodes out from each other so that I can control when the slideshows are displayed and when the videos are displaye... | If you don't want normal shortcode mechanics (seems like it to me from your description) why bother adding them to content at all? Create couple of specialized meta boxes and you won't have to deal with scanning and filters at all, just store/retrieve info that you need separately to/from custom fields. | Help with add_filter('the_content', 'some_function') and multiple matches | wordpress |
I'm trying to display a post, from a custom post type based on a meta value in that post type, in this case a checkbox that says "if this is checked show it on the front page. Usually I write a query using meta_key = > front_event value => true. But this does not work for custom post types. So I have this: <code> <?... | Try to wrap <code> true </code> with quotes <code> <?php $event =array( 'post_type' => 'Events', 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => 'front_event', 'value' => 'true' )) );?> </code> | Pull a post based on a meta value in a custom post type | wordpress |
when I insert an image into a post, the <code> <div> </code> that contains that image (and thus any caption) is set to be wider that the image itself. For example, I have added an image that is 211px wide. The <code> <div> </code> that houses the image has an element style of 221px. Is there a way, other th... | something I wrote a while ago: 'Adjusting Caption Frame Width' | Wordpress adds extra width to post images container boxes | wordpress |
Hi: I need to add a page to my very first WP site, which, at present, only has 4 pages on it (though one page has photo albums on it, which generate their own pages). I built the theme, the site is very simple, and up until now, has been fine. But now I seem to have a phantom page I can't find, can't delete, and can't ... | it's an attachment post. when you upload files, WP generates an attachment, which is just a type of post in WP, and has it's own URL. your image is named mountainrose, hence the mountainrose.html URL. Also, you should accept answers to your questions, people will be unwilling to help you with a 0% accept rate. I'm feel... | Phantom page can't get rid of/can't get at to change | wordpress |
Another question. I have a custom post type called "Articles" Within that I have registered some taxonomies using register_taxonomy called "Article Topics" So my client would pop over to Articles, put in a new article, fill out the publisher, and link to where its published, choose the topic its about...all good. Excep... | Have a look at the codex page for <code> wp_list_categories </code> . <code> $args = array( 'taxonomy' => 'article_topics' ); wp_list_categories( $args ); </code> For the taxonomy terms assigned to individual posts, <code> get_categories </code> also accepts a <code> taxonomy </code> argument. | Display Registered Taxonomies | wordpress |
I tried to strip down the Twenty Eleven theme options page and add my own fields correction: I followed a tutorial somewhere, but when I try to echo the data, it comes out multiple times. Here is my theme-options.php: http://pastebin.com/HSZM56jA This is how I am echoing it: <code> <?php $options = get_option('gavsi... | The options are being output within the loop, so are being repeated for each iteration of the loop. To check within the loop and only output something on the first iteration: <code> while ( have_posts() ) : the_post(); if( $wp_query->current_post == 0 ): // this is the first post // output your options endif; // oth... | theme options echoing multiple times | wordpress |
I'm using v1.4.14 of the WPAlchemy MetaBox PHP Class . I have 2 select menus within a repeating group, <code> available_from </code> and <code> available_to </code> . If I select Monday in the first select menu, Wednesday in the 2nd, and then save the post, the 2nd select menu's value changes to the first. So both beco... | grab version v1.4.15 | WPAlchemy issue when using 2 select menus with the same values inside a repeating group | wordpress |
I have the following code in my sidebar.php file: <code> <ul class="list-posts"> <?php $lastposts = get_posts('numberposts=5&orderby=date&cat=-52'); foreach($lastposts as $post) : setup_postdata($post); $page_name = $wp_query->post->post_name; if (is_page_template('news-page.php')) { ?> <p&... | Okay, turns out my <code> query_posts </code> code in news-page.php was in the wrong place. See my updated question (Edit no. 3). | if statement in sidebar.php checking page id or template or title | wordpress |
getting posts by cat with get_posts but need to exclude another cat called london or id 10. is this possible? best, Dc. <code> // array(7,-10) $laargsM = array('category' => 7, 'posts_per_page'=>300, 'orderby'=>'title', 'order'=>'asc' ); $la_shapes = get_posts( $laargsM ); </code> | as 'get_posts()' uses the 'WP_Query()' parameters , i would assume that this should work: <code> $laargsM = array('category' => 7, 'posts_per_page'=>300, 'orderby'=>'title', 'order'=>'asc', 'category__not_in' => array(10) ); </code> | exclude category from get_posts? | wordpress |
We are using relative image URLs in the post's HTML code. Looks like relative src links break on many RSS readers. By default, Wordpress does not seem to prepare post's HTML for feed too much. Does there exist any solution for post-processing the feed URL and encoring all links and src attributes to be absolute? | Relative URLs are considered bad practice in WP, because of such issues and that they can be much more complex to migrate. Basic approach to fixing this (not counting changing to absolute URLs everywhere) would be to filter <code> the_content </code> , while checking for <code> is_feed() </code> , and adjust links on t... | Forcing absolute src links in the RSS feed | wordpress |
There is a widget categories which prints categories as tree, for example: <code> category1 subcategory1 subcategory2 category2 subcategory1 </code> I would like to print whole content of blog together with articles not as widget but on main page as normal text like: <code> category1 subcategory1 news1 news2 subcategor... | there is some idea in 'Hierarchical Category List with Post Titles' which might need some adaptation to get exactly what you want. | List of contents of entire blog | wordpress |
I'm creating a simple plugin to set a page as a homepage from the list pages (to appear next to edit, preview, trash actions etc), I was just wondering what that the most appropriate/secure place to submit this information to? By far the easiest way would be to just post back to the plugin file itself with a $_GET para... | To me it makes sense to send via GET to the page you are currently on. That way you just hook into <code> admin_init </code> and check for your GET variables. As for security you can pass nonces via URLS: http://codex.wordpress.org/Function_Reference/wp_nonce_url | Where should my plugin POST to? | wordpress |
Is it possible to enable a second content area in the edit screen if a certain template is chosen? I have seen plugins like the second section plugin but that enables it for all pages I would like to only have the second section if a certain page template is chosen for a page. | You could add a metabox for your second content section, then hide it with a bit of javascript if the current template isn't a specific template: <code> current_template = jQuery('#page_template').val(); if( current_template != 'my-special-template.php' ){ jQuery('#_your_meta_box_id').hide(); } </code> then bind a func... | How to add a second content section when using certain page template | wordpress |
Which file of wordpress manage the plugins functionalities. For example if a have to insert another rule in a plugin functionality where i go to modify? | There should never be a case where you edit the core. Filters and actions were created so plugin developers could navigate the intricacies of Wordpress wihtout touching core files. You should reference the following: http://codex.wordpress.org/Plugin_API/Action_Reference http://codex.wordpress.org/Plugin_API/Filter_Ref... | Which file of wordpress manage plugins functionalities? | wordpress |
Whenever I click on the Author link, I get redirected to the home page. I've set up the author.php page according to the instruction on codex, but still no luck. Does anyone have any other suggestions? | Under the plugin's settings SEO > Indexation, scroll down to Archive Settings and make sure 'Disable the author archives' isn't checked. | Wordpress Author Page | wordpress |
Wordpress sometimes "guesses" a redirection for a nonexistent page slug if the slug is at the beginning of another URL. After some searching, my hypothesis is that this part of the canonical redirection functionality, which can be disabled using this code: <code> remove_filter('template_redirect', 'redirect_canonical')... | It's a bit hacky, but this should work: <code> function no_redirect_guess_404_permalink( $header ){ global $wp_query; if( is_404() ) unset( $wp_query->query_vars['name'] ); return $header; } add_filter( 'status_header', 'no_redirect_guess_404_permalink' ); </code> | Stop Wordpress from "guessing" redirects for nonexistent URLs | wordpress |
I'm trying to create own template including submenu instead of the regular sidebar in Twenty Eleven. Although I manage to create and select my new template the page ends up with bad CSS. Here is what i have done Copy sidebar-page.php and named it submenu-page.php Copy sidebar.php and named it sidebar-submenu.php In sub... | the layout is controlled by the .singular css class, which in turn is generated in functions.php depending on the template. in your child theme of Twenty Eleven (if you don't have a child theme, create one first) add this code to functions.php: <code> add_filter('body_class', 'wpse_28044_adjust_body_class', 20, 2); fun... | Duplicate and alter sidebar for Twenty Eleven | wordpress |
I've got a highlight section on the header of my website which shows the title and the thumbnail of the last X posts having a thumbnail. Is there any custom query which allows me to retrieve only the last X post having a thumbnail? At the moment I'm retrieving the last X * 10 posts (because not all the posts have a thu... | try to work this into your query: <code> 'meta_key' => '_thumbnail_id' </code> http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters | Query the post which have a thumbnail | wordpress |
Here's my use case: a client will be making numerous blog posts, some of which are portfolio pieces of his recent work. This sounds like a perfect use case for a Post Format, but no "portfolio" post format exists. Post Formats are meant to be standardized, common formats, such as gallery, quote, status etc. Unfortunate... | You can't create custom post-formats. What you could either do is have a post category called portfolio and then use the body/post class specific to that to control the display on the front end, as this is what post-formats are designed for, or go for a custom post type. Personally I go by the idea that, if it makes th... | Custom Post Formats | wordpress |
as always after struggling my mind for 3 days with a problem i decide to ask for help here. Im trying to create an advance search page with taxonomies and keyword field. You can see what i actually got in http://alianzasuperior.com/empleo/busqueda-avanzada/ ( dont panic, its spanish but just think as taxonomies and you... | like other times, after posting here i found my own question. Maybe its not the smarter solution but its working for me. Im using the new tax_query as commented in http://www.wpmods.com/query-multiple-taxonomies-in-wp-3-1/ Basically if i get 2 taxonomies with two terms for example <code> $job_type='full-time+free-lance... | Create Advanced search with taxonomies (not filter list) | wordpress |
It seems that my contact form's ajax javascript and the custom.js that I'm using for my drop-down navigation are interfering with each other. The contact form's ajax fuction will only work properly if I won't call the "custom.js" in the header. Furthermore I've had troubles using some jquery sliders, too, because somet... | By default, the jQuery script is loaded in no conflict mode. I noticed that you have in you header.php the following code: <code> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.4.2.min.js"></script> </code> Adding jQuery like this, will override (if the page w... | Properly embed javascript into WP (using function.php) - doesn't work? | wordpress |
Wordpress provides conditionals like is_home() and is_category(). I'd like a function to tell me if the current context belongs to a category that is a subcategory (so, not a parent). I tried this, but it returns true on any category (and subcategory) context <code> function is_subcategory($category) { if (is_category(... | try this: <code> function is_subcategory($category = null) { if (is_category()) { if (null != $category){ $cat = get_category($category); }else{ $cat = get_category(get_query_var('cat'),false); } if ($cat->parent == 0 ){ return false; }else{ return true; } } return false; } </code> Usage: <code> //to check if the cu... | Equivalent to in_category() for subcategories | wordpress |
I'm trying to add a specific role to manage my custom post types and I'm stuck at the very beginning. I've added <code> add_role() </code> to the functions.php file as following: <code> add_role('resourcerer', 'Resourcerer', array('read_internal_jobs')); </code> and created a user with that role. However, when I try to... | That's because the "normal" capabilites that are needed to login are missing. You should simply load the capabilites of some default role and attach them to your custom role before using it on a user. EDIT: Solution from @dashalune (OP): <code> add_role('resourcerer', 'Resourcerer'); $role =& get_role('resourcerer'... | After adding add_role to functions.php and creating a user, can not login into admin | wordpress |
Why I'm doing this you might ask? I'm developing a website for a business with a portfolio where the gallery items are posts. These posts are populated through custom fields and category selections, nothing else. For each item, there could be a title/content or not, it depends on the item in question and that's entirel... | If the post content, title and excerpt are empty WordPress will prevent the insertion of the post. You can trick WordPress by first filtering the input array so empty values are set to something else, and then later resetting these values back to empty strings. This will bypass the standard check. <code> add_filter('pr... | How to publish a post with empty title and empty content? | wordpress |
I'm using media temple with a fresh install of WordPress in network mode. With subdomains off. <code> define( 'SUBDOMAIN_INSTALL', false ); </code> I've followed Media Temple's *wildcard configuration (not that I think it matters) and I'm finding that when I create a new site nothing is working except it displaying a v... | Actually, it is because you set up wildcard subdomains. You don't need to set them up if you just want to use subfolders. Because of this, <code> http://test.shallbetterdesigns.com/wp-content/themes/twentyeleven/style.css </code> can be found, but <code> http://www.shallbetterdesigns.com/test/wp-content/themes/twentyel... | Unable to apply theme to WordPress Network Site install | wordpress |
My client is looking to start taking online registration for their many conventions and events. Previously they handled this all offline with PDF documents and in person payment. I'm looking for either a plugin or a detailed FAQ that will help me integrate an online registration plus payment system into their Wordpress... | Wordpress + Gravity Forms is all you'll need for this project. Gravity Forms even has paypal integration. Set up a registration form, add on payment and you're ready to roll. They have detailed instructions and tutorials on how to set everything up and a very active forum if you run into any issues. | Create a registration form with a PayPal checkout fee? | wordpress |
I'm pretty new to WP, so please forgive any stupid questions and/or coding! I'm using the following code in my index.php file to include content from another page: <code> <div id="tm-container"> <?php $page = get_page_by_title('Today's Menu'); $content = apply_filters('the_content', $page->post_content); ec... | Okay, I worked it out - fudging it slightly, but it works. I kept everything as is, and added <code> overflow:hidden </code> on <code> #tm-container </code> , then moved the page link outside <code> #tm-container </code> . The biggest problem was that the contributing page contained a menu with many paragraph breaks, w... | how to include page content to specified length & then "read more" link | wordpress |
I have a plugin request that I cannot find by a Google search because I can't think of what it would be called: I need a plugin that will, on a page-by-page basis, allow me to define a list of tags (probably via a Custom Field), and should show the most recent 5 (or any number) posts that have that tag on the bottom of... | Here's a quick shortcode I put together for your <code> functions.php </code> file if you want to use it as a starting point. or it can be converted to a plugin if you prefer. <code> function wpse27961_show_tagged_posts( $atts ) { extract( shortcode_atts( array( 'tags' => '', 'number' => 5, ), $atts ) ); $args = ... | Posts with Tag on Bottom of Page | wordpress |
Ok, that's a weird question, I know.. I'm so confortable with WP that I don't want to use any other application to generate XML (KML - Editors note: These are Google Earth files. ) files. I want to use a custom post type with nothing else just a bunch of custom fields and meta boxes. I have the XML schema (a custom sin... | If you're using XML to send Ajax requests, then WP has something built in: <code> $response = new WP_Ajax_Response(); $response->add( array( // This is the parent elements name 'what' => 'xml_parent_el' // 'data' can only pass CDATA ,'data' => $foo // 'supplemental' can only pass elements with a unique name ,'... | Create XML files on post edit screen | wordpress |
This question follows on from this one: stackexchange-url ("Bar separated navigation by extending Walker_Nav_Menu") I'm trying to do the same thing but this time I'm extending <code> Walker_Page </code> instead. The issue I'm having is that I'm setting the depth to 1 and in that depth there might be 4 pages. But in the... | This is what I went with in the end. Although it only will work correctly if you are using a depth of one: <code> class Bar_List_Walker_Page extends Walker_Page { public $count; public $running_count; function __construct() { $this->count = 0; $this->running_count = 0; } function start_el(&$output, $page, $de... | Bar separated navigation by extending Walker_Page | wordpress |
I built a plugin for my company, which basically goes to tube sites, scrapes them for content, and posts them automatically in whatever state is defined (publish, draft, future, etc). Now, everything goes well when I manually add a post through the plugin: it opens a cURL to the sites, grabs the videos and embeds, take... | Well, I've found my own solution, thanks weston, but I believe mine is a bit easier :) from the function which calls to insert post, you do the following for simplicity's sake: <code> kses_remove_filters(); wp_insert_post( $post ); kses_init_filters(); </code> And voila! there's a new post. | WP Cron is "half-failing" to insert posts | wordpress |
What plug-ins there are available to allow people to leave comments using their Facebook and Twitter logins? Any special considerations or recommendations? I am currently allowing comments with the email addresses (default setup), but there are certain problems in this approach (spam being one). | Both Simple Facebook Connect and Simple Twitter Connect have features to allow users to post comments using their Facebook or Twitter credentials. Among other things. Disclaimer: I wrote 'em both. | Twitter/Facebook login for comments | wordpress |
I am showing the featured image on a custom post template, and I want to insert a "more images" text link to the gallery of attached images. Wordpress has instructions for inserting the gallery directly via but I want just the link, or better yet a modal popup to view the gallery. I have tried a variety of plugins, but... | There's no such thing as a link to a gallery, a post has a gallery by virtue of it having child attachment posts, it's not a separate entity. You could achieve the modal window by using some sort of lightbox plugin and modifying the gallery shortcode to output the images as just anchor links with the same rel attribute... | Get post image gallery link | wordpress |
I've tried several plugins that supposedly allow you to "insert all images" after using the flash based uploader to upload multiple images. However, I still haven't found one that ties in well with the latest version of wordpress in a non-hacky way. Which plugins the most for inserting multiple images? | http://wordpress.org/extend/plugins/faster-image-insert/ | What's the best "insert all images" plugin? | wordpress |
Currently I have successfully added a row of shortcode buttons to the TinyMCE editor in WordPress. The problem is, only admins can see the row, and I need contributors and editors to see it too. I have checked the Codex for add_action and add_filter and I can't see any specific arguments to indicate user roles or anyth... | Your if statement wants the user to be able to posts AND pages, which only applies to admins and editors by default. Are you sure editors cannot see the buttons? If you want anybody who can edit posts to see the buttons (e.g. authors and contributors) take out the check for <code> edit_pages </code> or make it an or st... | How do I add a TinyMCE row that all users can see, instead of just admins? | wordpress |
404s are not triggering my 404.php template. The header status code, checked in firebug, is a 404, but the page that gets displayed is like a loop with 0 items (as if this were simply an archive page with 0 entries). If my permalinks start with /%year%/ and I go to bla.com/9999 (which should produce a 404), WP Debug sh... | I found that the problem was with the otherwise very useful plugin Legacy URL Forwarding . It uses the following function (abridged here) with the <code> 404_template </code> hook. <code> function doUrlForwarding() { // make a $query based on the $_SERVER['REQUEST_URI'] // if a post is found, redirect to it if (!empty(... | Why are 404s not triggering my 404.php template? | wordpress |
I am trying to use my own styles.css for inside the body of the visual editor for my pages. However, when i add <code> add_editor_style('styles.css'); </code> to the functions.php page it doesnt change anything (font color, boldness, etc) inside the body of the visual editor. I use firebug and check to see if it even l... | You don't have to specify a file for the editor style. Just use <code> add_editor_style(); </code> in your <code> functions.php </code> , and then create a file called <code> editor-style.css </code> in your theme folder. You may want to look at some examples (e.g. Twenty Eleven) for some of the TinyMCE-specific rules,... | Custom styles.css sheet for visual editor | wordpress |
I'm trying to load a script from <code> functions.php </code> just when I'm on the front page. I set a static page called "home" in the reading options. The home page loads the <code> front-page.php </code> template correctly but the conditional script loading doesn't work. This is what I have in my <code> functions.ph... | If you are doing this directly in <code> functions.php </code> you are doing it wrong. It is too early for conditional tags to work. This should be hooked to <code> wp_enqueue_scripts </code> , see <code> wp_enqueue_script() </code> docs. | is_front_page() not working | wordpress |
Is it possible to retrieve post entry for a custom post type by tag, I have been trying with the following code, however it just locks me into a infinte loop. <code> <aside class="supporting_images"> <?php /*<?php if($post->ID == 241) : echo apply_filters('the_content', '[slideshow=3]'); endif; ?> <... | You'll need to setup the post for the query by changing the following line to get rid of the infinite loop. <code> <?php while ($query->have_posts()) : $query->the_post(); ?> </code> If your looking for a custom post type, you'll need to specify that in the query arguments: <code> <?php $query = new WP_Q... | get custom post type by tag | wordpress |
I have been working on a plugin for Wordpress, that updates an XML file with elements from the post. I have used a third party plugin to create the field for the XML, and so far that is working. I am having a lot of trouble with the XML and the hook itself. I am using a DomDocument example from php4every1.com, and that... | The 1 character output error is probably because you have a single space before <code> <?php </code> or after <code> ?> </code> . As far as it not doing anything, where is the fruits.xml file? this line: <code> $xml->load('fruits.xml'); </code> in this context is looking for the file at: <code> /your/server/pa... | Problems with creating hook that updates XML | wordpress |
I want a simple to use slider for the home page of the website I have played around with a bunch of plugins and nothing was really suiting my needs or easy to deal with. I would rather not spend the time to build my own. Here are the requirements I need Allows More than one slider with different image sizes(sized to ba... | Here is what I did just in case anyone wants to copy it noticed a lot of people looking set a category of your choice and featured image will be the slide for that title will be displayed and the whole thing is permalinked here is the HTML/PHP to generate it <code> <div id="slider"> <ul id="featslider"> <... | Best Wordpress Slider Plugin for HTML and Images | wordpress |
Is it possible to edit a website live? I.e simply click on the text you want to change and start typing. I've found something like this - http://plugins.elliotcondon.com/live-edit/ . It's not quite what I want but it's close. So instead of clicking on some kind of admin button to open up a window you would click direct... | I can suggest http://wordpress.org/extend/plugins/front-end-editor/ Probably its what you looking for. | Directly editing content on webpage, is it possible? | wordpress |
Been all over looking for the best way to do this. I want to get the ID of the latest post of a certain post_type. How can I do this in the cheapest way possible (by cheapest I mean using the least queries, and no loops or post rewinding)? Surely there is a quick method? | <code> $latest_cpt = get_posts("post_type=yourcpt&numberposts=1"); echo $latest_cpt[0]->ID </code> The only cheaper way than above, I can think of, would be to write your own SQL query to just return the one post and only the column ID. | Get the ID of the latest post | wordpress |
I've got a buddy who's trying to organize his recipe blog and would love to have an archive page that displays his recipes broken up by broad subject areas (read: categories) and then have the recipes listed alphabetically under each section (similar to this ). Do I need to go the custom query route, or is there a bett... | I found a plugin that does pretty much exactly what I need: List Category Posts . Just throw in a few shortcodes under some H3's and I'm golden. grin | Easiest way to display post archives in category-then-alphabetical order? | wordpress |
Hey all i am trying to find the section within the edit.php page where it populates the table with all my current pages. What i want to do is add another colum to the table in order to launch a side page for changing a picture. Could anyone point me to the code that populates the table? Thanks! David | Here is how i did it: <code> /****** Add Thumbnails in Manage Posts/Pages List ******/ if ( !function_exists('AddThumbColumn') && function_exists('add_theme_support') ) { // for post and page add_theme_support('post-thumbnails', array( 'post', 'page' ) ); function AddThumbColumn($cols) { $cols['thumbnail'] = __... | Add column to pages table | wordpress |
I'm having a problem with the_excerpt and can not find the answer anywhere... I simply want to allow links to be clickable when they are displayed via the_excerpt! There has to be a function for this, rather than relying on a plugin. But I can't find it and the advanced excerpt plugins are so complex that I am unable t... | You can use the script I found here: http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/ I've modified it to show links in the excerpt, and removed some of the other functions: <code> <?php function keep_my_links($text) { global $post; if ( '' == $text ) { $text = get_the_content(''); $text = apply_fil... | Display Links in Excerpts? | wordpress |
Am relatively new to Wordpress development and looking for the best way to customize the output for a specific javascript app that will be pulling in the content dynamically, by using a Wordpress plugin. I can do most of what I need to do by overriding the feed template, allowing custom output by search term, tag, and ... | Looks like this does the trick, using the <code> template_redirect </code> hook within the plugin: <code> function my_app_request() { global $wp_query; if ( array_key_exists('mycustomvar', $wp_query->query_vars ) ) { include( dirname( __FILE__ ) . '/templates/content-single.php' ); exit; } } add_action('template_red... | Custom feed parameters / Template overriding | wordpress |
Sorry, this is a noob question. But, I want to follow the best practices. I read that functions and global variables should be prefixed in plugins. So, for example, <code> myfunction() </code> , should be <code> lax_myplugin_myfunction() </code> . And a variable, such as <code> $myvar </code> , should be <code> $lax_my... | Functions - yes. Class methods - no (but prefix the class name). Variables - inside your functions/methods - no (like in your example); inside template files - yes, because there are lots of global variables exposed by WP in them, and you might get conflicts... | Do I Need to Prefix Variables Inside Functions? | wordpress |
I'm hitting the wall for nearly two hours now, trying to figure this out. Here is the thing' I have made a xml parser to read xml file and add posts (with content) from xml: <code> $ch = curl_init( "http://abc.xml" ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); $data = curl_... | Maybe if you use <code> add_post_meta </code> instead, because <code> update_post_meta </code> assumes that you have already that value and you are updating it ( from http://codex.wordpress.org/Function_Reference/update_post_meta ). Also check if <code> $doc->prod[$i]->awImage </code> is actually a string (do <co... | update_post_meta, xml parser | wordpress |
I'm willing to develop a thesaurus/dictionary for the Berber language . A website that allows comunity members to add new words/synonyms/antonyms.. How to relate words (posts) to each other? by using tags? but with this approach, it's hard to keep organization when posts names/slugs are modified; then tags should be up... | I would create custom post types and custom taxonomy, taking the standard "Posts" out of the loop. You can then have two separate Taxonomies (Tag systems) for synonyms and antonyms. http://codex.wordpress.org/Post_Types http://codex.wordpress.org/Taxonomies You can then use a plugin like Gravity Forms to have your user... | Wordpress as thesaurus/dictionnary: what approach? | wordpress |
I'm developing a directory style theme using multi-site and each new author needs to be able to upload 5-10 photos to be displayed in their profile page. Is there any way of doing this? I don't mind if it's a plugin as this theme is for a client and not for general release. | You can use this for an author photo: http://wordpress.org/extend/plugins/user-photo/ And this one might give you multiple images for the author: http://wordpress.org/extend/plugins/sem-author-image/ The final approach is to use a gallery plugin of some kind (NexGen Gallery Perhapse?) and create an album for each autho... | Add multiple images to author profile page | wordpress |
Even though this question sounds like others here is my problem: The site I am updating had a permalink structure of <code> /%postname% </code> , during this time I created a custom post type of "popups" (rewrite slug = 'popups') so the urls were: <code> /popups/the-post-name </code> Now the site has a blog, and the pe... | When you registered the post type, one of the arguments was rewrite, which took an array. make sure there's a <code> with_front </code> argument in the <code> rewrite </code> array, and set it to <code> false </code> . <code> <?php $args = array( // other stuf... 'rewrite' => array( 'slug' => 'popups', 'with_f... | How to have a custom URL structure for a custom post type? | wordpress |
I have a number of category terms act as placeholders for our departments. I than pull in those terms on the backend profile edit screen using Justin Tadlock's tutorial: http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields and the following code by stackexchange-url ("sanchothefat") ... | Try the WP_User_Query , something like: <code> $term = get_queried_object(); $users = new WP_User_Query(array( 'meta_key' => 'your_meta_key', // the key in which you store your terms 'meta_value' => (int)$term->term_id, // assuming you store term IDs )); print_r($users->get_results()); </code> A update base... | List all authors by matching custom meta data on a category page | wordpress |
I want to submit comments via ajax. CLick the comment submit button, comments gets posted via jquery's ajax method and the result ("Awaiting moderation...") is displayed on the page. I went into the scripts.js file and added a click handler for the button. It validates and then does an ajax submit but this is not worki... | you might find these links handy if you're going to code it yourself http://byronyasgur.wordpress.com/2011/06/27/frontend-forward-facing-ajax-in-wordpress/ http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ I am fairly sure your URL is wrong url: "../wp-comments-post.php" - ajax in wordpress has to be s... | Ajax submit comments | wordpress |
For example, if I have a Custom Post Type called "Video" and I want to show the length of that video in the main (edit.php) table listing, how can I manipulated the columns shown in that table? | it's similar to adding columns to regular posts, except the filter and action are slightly different: <code> manage_edit-{$post_type}_columns </code> and <code> manage_{$post_type}_posts_custom_column </code> <code> function wpse27787_add_video_column( $columns ){ // add a new column to array of columns // can also uns... | How does one customize the table of listings for a custom post type? | wordpress |
I keep hearing that Wordpress is the best SEO solution, better than most static websites because of multiple reasons. I then go on to hear contradicting information elsewhere. So: Is Wordpress generally more SEO friendly/ready then most static html websites? What makes it more SEO friendly? Can I take any SEO tips from... | When you hear about SEO-friendliness of CMS it is essentially same as for static page - how URL looks and what gets into source of page. Essentially WP is considered SEO-friendly because: It is easy to get pretty permalinks enabled and working There is large choice of themes and plugins, aimed at following recommended ... | What makes WP so SEO friendly? | wordpress |
I have another database which stores post's IDs and I want do display them using WP_query to use the WP default pagination. I'm using orderby => none to preserve the original order, but the result reorders them by IDs. <code> $ids = array (60, 23, 78, 46, 105, 130) $args = array ( 'posts_per_page' => -1, 'post__in' ... | You can order them manually after the query is complete: <code> $ids = array (60, 23, 78, 46, 105, 130) $args = array ( 'posts_per_page' => -1, 'post__in' => $ids, 'orderby' => 'none' ); $query = new WP_Query ( $args ); $ordered_posts = array(); foreach($ids as $rpid) foreach($query->posts as $index => $... | WP_query 'orderby=none' Problem | wordpress |
Is there any particular reason why index.php in most templates usually seems to go all the way from just after the start of #main to right before it's closing tag, with that closing tag contained in footer.php. In my theme it would be handy to have #main's closing tag in the index/single/page files not in footer.php ( ... | It's a personal choice. If the containing markup is consistent across all templates it doesn't matter if they're in the template or header/footer, it's just one less bit of markup that gets repeated in every template. | where to split off footer.php | wordpress |
From the codex <code> is_active_sidebar( $index ); ?> Parameters $index (mixed) (required) Sidebar name, id or number. </code> When i try any of my sidebar names it doesnt work; yet when I put in random numbers 1,2 and 3 guessing that my sidebars are numbered that way and it works, but this is not reliable. There is... | Found a solution to the problem. I added a line of code id => 'my-sidebar-id' to the register_sidebar array so now i know the sidebar ID. There may be another way of doing it but this method seems to work fine for me now anyway. <code> if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Rig... | how do I get a sidebar's id or number for use with is_active_sidebar() | wordpress |
Wondering if its possible to deactivate a plugin in the deactivation code of another plugin? IE. i have a widget that i'm adding via its own plugin that won't function if the 'master' plugin isn't activated... | Yes, register a deactivation hook in your first plugin, and inside this hook deactivate the 2nd plugin using the <code> deactivate_plugins() </code> function | Deactivate plugin upon deactivation of another plugin | wordpress |
Is there an action_hook or something similar that could help me achieve this? I tried adding markup in a PHP string variable and just fired off an email with the wp_mail function like so: <code> $email_to = 'someaddress@gmail.com'; $email_subject = 'Email subject'; $email_body = "<html><body><h1>Hello... | from wp_mail codex page: The default content type is 'text/plain' which does not allow using HTML. However, you can set the content type of the email by using the 'wp_mail_content_type' filter. <code> function wpse27856_set_content_type(){ return "text/html"; } add_filter( 'wp_mail_content_type','wpse27856_set_content_... | Is there a way to send HTML formatted emails with Wordpress' wp_mail function? | wordpress |
I have this template file called Events. The purpose of this file is just to display the latest post with custom type Event. I have solved it with a very ugly solution. There must be a simpler and more correct way to do this. If you check my code im sure you understand what im trying to accomplish :) Thanks in advance!... | If you want to use the proper archive page (e.g. <code> example.com/events </code> ), make sure that you register your custom post type with <code> 'has_archive' => true </code> and then create an <code> archive-events.php </code> in your theme (changing <code> events </code> to whatever you've named your CPT). To s... | Display custom post type from template | wordpress |
I have a sitemap - http://www.teamworksdesign.com/page-sitemap.xml Why are some of the links within the sitemap greyed out? Also is it worth changing the priority of some of the pages to achieve better seo results? | Grey links are how it styles visited ones. Priority is mostly for indexing purposes (as is rest of sitemap), I highly doubt is has any impact on search engine ranking. | Yoast SEO plugin - Sitemap links greyed out & page priority | wordpress |
I have a weird problem that happens only in one of my Wordpress sites (which is on a development server with many other wordpress sites that don't have this problem): When I make changes in code - be it php, css or html - I can't just go to my site and refresh the pages for the changes to show up. I have to go to the t... | In the end we disabled all plugins, then turned them on again, and miraculously - the problem disappeared :) | Changes in code only show after changing theme | wordpress |
Need some help with this URL rewrite. I have 2 custom posts set up, 'company' and 'job'. I have a single-company page, and a single-job page, which work fine. A company can have many jobs, and I'm managing the relation between jobs and company using post meta. Single company URL is <code> http://..../company/abc-intl <... | Here's the solution if anyone comes across such a 'weird' requirement ;) Also, when the job CPT (or any CPT you want to associate) is published, you need to save the id of the company CPT (whose slug will be used for forming the other part of the permalink) as a post meta for the job. <code> <?php add_filter('init',... | Combine 2 different custom post slugs into a single permalink? | wordpress |
I have a folder inside my theme where I hold some txt files which I am including in a theme. The problem is that before including txt file I need to check if it does exist. I fail checking it the following way and have no idea why it wont work, always returns false. <code> $themeLocation = get_bloginfo('template_url');... | You are trying to check it by URL, which makes no sense to <code> is_file() </code> which expects local path. By the way I'd use <code> file_exists() </code> instead. Try: <code> $fileName1 = TEMPLATEPATH . '/txtfolder/file1.txt'; </code> | How to check if txt file exists inside template folder? | wordpress |
WordPress uses MYSQL, which is released under GPL. So I think Workpress MUST be under GPL. But my friend said WordPress doesn't include MySQL program when it released, so it can be released under other license, and don't need to open source. Which is correct? | You can find it on the Wordpress website, under "License" . It is GPLv2 MySQL is not a part of WordPress, WP simply uses it. Their licenses are unrelated. The license under which the WordPress software is released is the GPLv2 (or later) from the Free Software Foundation. A copy of the license is included with every co... | Does Wordpress have to be released under the GPL? | wordpress |
i'd like to import a flash audio player in my wordpress theme, the import of the file works fine because it shows up on screen, responds to the click on play/pause, but the sound does not start. edit : i found out the path has to be modified in the .as file, with the right path. Thanks sancho All the files are in : /Ap... | You should be putting in the URL rather than a system path as the flash will requesting files via http. Say your site is on http://localhost/wordpress/ ... Your URLs need to look like http://localhost/wordpress/wp-content/themes/maVersion/audio/dance.mp3 | problem of path with xml file | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.