question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
My theme has a slider widget that allows the end user to select a category and it assigns the posts in that category to the slider. If a post has a featured image, its used as the background of the slide for that post. However, there are cases where the featured image on the post itself needs to be different that the o...
This plugin has worked for me in the past: http://wordpress.org/extend/plugins/multiple-post-thumbnails/ Or you could create a custom field - Advanced Custom Fields makes this very easy (and for the end user too): http://plugins.elliotcondon.com/advanced-custom-fields/ This could be integrated by using the traditional ...
How to add a 2nd "featured image" to a post?
wordpress
I'm not sure what I'm doing wrong here. I have a field called "grid_thumbnail" and a "related_projects" post_object. I am able to display the title of the related post. I just don't know how to get the Image URL of that related post. Suggestions? <code> &lt;?php foreach(get_field('related_projects') as $post_object): ?...
There is a second parameter on <code> get_field() </code> which you are not using, try this line instead: <code> &lt;img src="&lt;?php echo get_field( 'grid_thumbnail', $post_object-&gt;ID ); ?&gt;"&gt;&lt;br /&gt; </code> Docs: <code> get_field() </code>
Advanced Custom Fields Plugin - Unable to get URL from post_object
wordpress
I'm trying to get into grips in using AJAX in wordpress, the following code creates a form with an input box using the wordpress feature shortcode [ajaxf]. <code> &lt;?php add_action( "wp_ajax_ajaxcf", "my_action_callback" ); add_action( "wp_ajax_nopriv_ajaxcf", "my_action_callback" ); function my_action_callback() { $...
This is just a simple javascript issue. When your javascript that attaches the click behavior to the form is parsed, the form element doesn't yet exist because it's further down the page, so it doesn't get attached. Either move the javascript below the form, wrap it in a <code> jQuery(document).ready() </code> , or use...
Not sure why wp_ajax isn't working?
wordpress
I want to use a Nivo slider to cycle through the children of a parent page one by one, how can I do that? I have the following piece of code that grabs ALL the children of a parent page and displays them: <code> &lt;?php $pages = get_pages(array('child_of' =&gt; $post-&gt;ID)); foreach($pages as $post) { setup_postdata...
To get attached (i.e. child) images of a post, try using <code> get_children() </code> . e.g.: <code> &lt;?php $child_image_args = array( 'post_mime_type' =&gt; 'image', 'post_parent' =&gt; $postID, 'post_type' =&gt; 'attachment' ); $child_images = get_children( $child_image_args ); ?&gt; </code> Which returns an assoc...
Loop through child images of a parent for a Nivo Slider
wordpress
We're developing a set of websites, complex ones with a lot in common, and the company have decided to use WP as a base CMS. As in every site, there is a design process, followed by HTML, then development/CMS integration. However, I'm wondering how would that work with WP? Do companies design all templates, then HTML, ...
If you are comfortable with a source control system such as <code> git </code> - one approach I have used successfully is to create a 'lowest common denominator' theme with all the standard functionality shared between the sites and nondescript styling (black and white, standard reset and typography styles etc). Then t...
design and development workflow
wordpress
I'm thinking of using WordPress for my new website. It's a photography based website and the client will be uploading groups of photographs primarily. They'll want to give it a title and upload up to 20 photographs. Is this possible through WordPress? To get rid of content in the form of text and instead, opt to upload...
There are many themes that focus on photography. Here are some examples: Gallery Theme Fotofolio ... and many others - just search for photo or photography or portfolio themes. Good luck!
Photography Based Design - Multiple Images Per Post
wordpress
I'm creating new categories with galleries taxonomy : <code> $wpdb-&gt;insert("wpem_terms", array( 'name'=&gt;'Custom Category', 'slug'=&gt;'customcategory', 'term_group'=&gt;0, )); //id of term $id = $wpdb-&gt;insert_id; $wpdb-&gt;insert("wpem_term_taxonomy", array( 'term_id'=&gt;$id, 'taxonomy'=&gt;'galleries', 'desc...
Try doing this: <code> $insert_post = wp_insert_post(array( 'post_author'=&gt;1, 'post_date'=&gt;date('Y-m-d H:i:s'), 'post_date_gmt'=&gt;date('Y-m-d H:i:s'), 'post_content'=&gt;'', 'post_title'=&gt;'', 'post_excerpt'=&gt;'', 'post_status'=&gt;'publish', 'comment_status'=&gt;'closed', 'post_name'=&gt;'', 'post_parent'=...
Setting a post's category
wordpress
I'm looking to export only wp_posts where post_type = post. Is that possible?
In your WordPress Dashboard, if you go to <code> Tools &gt; Export </code> , you can select your custom post type and export only posts in that post type. It gives you the option between All Content, Posts, Pages, and your custom post types following those three options. As for SQL, well are you looking to export the d...
Export SQL query based on post type
wordpress
Having trouble getting the achieve page of a custom taxonomy to know its that page. It just shows the detail from the default is_archive blog page... This is what i've tried.. <code> &lt;?php } elseif ( is_archive() &amp;&amp; is_tax() == 'article-area') { get_template_part( 'includes/inc-article' ) ?&gt; </code> When ...
shouldn't it be is_tax('article-area')
is_archive for custom tax archive page?
wordpress
I want to know about the plugins that help me to write the coded blocks. I have tried out two or three but I am not able to know how to get along and put it to use. Please suggest me some good plugins and also how to use it if I need to represent some codes. Yeah I have many different languages that I code in... so the...
From personal experience, I've found SyntaxHighlighter Evolved to be the best: You put your code inside a shortcode and specify the language: <code> [sourcecode language='php'] //Displays the php code [/sourcecode] [sourcecode language='html'] &lt;!-- Displays the html code--&gt; [/sourcecode] </code>
I want to know about the plugins that help in while I write code on my Page?
wordpress
I want to use the Google XML Sitemaps plugin and it says: "The plugin will not be active until you disable the multisite mode". I don't need a multisite mode.
http://wordpress.org/support/topic/disabling-multisite-with-wp-30 http://www.bloggingjunkie.com/disable-multi-site-option-wordpress-30.html
How can I disable the multisite feature of WordPress 3.0?
wordpress
I want a QueryLoop that exclude some categories and its subcategories, I have this: <code> $args = array( 'category__not_in' =&gt; array( 2, 6 ), ); </code> this exclude the categories, 2 and 6 , but no its subcategories, what can I do? ====== Update ======= This is what I did, but now I'm searching for a better soluti...
How about something like this where you filter the posts once the WP_Query gets them?
Exclude categories and subcategories in QueryLoop
wordpress
Before I get started, I want to acknowledge that there are some really good articles that are targeted at how to conditionally enqueue scripts based on page/post content. WordPress Plugin Development - How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts How to load JavaScript like a WordPr...
I copy pasted your code into my dev environment, changed nothing but the page name, and it works just fine. Are you sure that it's not being enqueued and you just have it pointed wrong or that the page is not named incorrectly or something?
How to conditionally enqueue a stylesheet only for a certain page(s)?
wordpress
So I limited the amount of characters per post via <code> the_excerpt('50') </code> but it removes the image that I added to my post. How can I bring that image back so it shows up above the post then limits the characters?
The problem is that the_excerpt() strips all HTML . There's a good reason for this: what if the 49th word of a 50 word excerpt was the first word of a bulleted list? Or the second word in an <code> &lt;h1&gt; </code> ? The way I would work around this is by using post thumbnails . These allow you to have an image you c...
Character Limit w/ Excerpt removes Images Why?
wordpress
I'm trying to change my RSS feed titles to display the post type beforehand but it's not working. Code below. Any ideas? Thanks <code> function changeRSStitles($content) { global $post; if (get_post_type($post) == 'literature') { $content = 'Literature: '.$content; } else if (get_post_type($post) == 'recipe') { $conten...
Got it working! Just had to resync the feedburner feed
Changing the RSS feed titles not working
wordpress
I just learned (with help from Rob Vermeer!) how to use one template and be able to call different top graphics depending on the page and now I want to know if the following is possible: I'm using the page.php (default template) for several pages. Layout for those pages are the same but sidebar content on each page wil...
If you're using static pages, try using <code> is_page() </code> for your conditionals. Let's assume your static pages have slugs, "customers", "vendors", and "services": <code> &lt;?php if ( is_page( 'customers' ) : get_sidebar('customer'); elseif ( is_page( 'vendors' ) ) : get_sidebar('vendors'); elseif ( is_page( 's...
Possible to have one template call different sidebars for different pages?
wordpress
I know there are a lot of Social Networking plugins around, so I thought I'd ask for some recommendations. When writing a new post in the admin area (standard post type), I'd like the option to post it (the excerpt and a link, for instance) to my Facebook and Twitter accounts. I'm not referring to buttons on the front-...
take a look at this tutorial http://wpmu.org/automate-your-facebook-twitter-wordpress-post-updates-2-plugins/ a or if you feel like using an external serviceyou can use http://twitterfeed.com which is not a plugin but will do the job more then fine.
Plugin recommendation - posting to Social Networking sites
wordpress
OK, here's my prob. I have static homepage and a separate posts page on my wordpress site. I have defined the two in the admin panel. Now, I have also set the max number of posts to be displayed to 5(in settings> reading), but all the posts(10+) are still being displayed on the blog page. I'm also displaying the latest...
This could be caused by a theme or plugin overriding the WordPress settings. You could try enabling the TwentyEleven or TwentyTen theme, as well as disabling any plugins, to see if it works then. If so, you could post which theme you are using (if it's prebuilt) or which plugins you had to disable to get it working - a...
Number of posts per page setting is not working?
wordpress
I have an old blog... 25 posts on wp 2.6. good content, valuable information, right to the point. I am about to update the blog and the posts. Make the posts more up-to-date (there are some 3 years old, and still new!) and repost it to media sites and create a buzz around this really good information. So the question i...
I will migrate the blog to wp 3.1, and add "add this". the others solutions is no reliable !
Serious social interaction
wordpress
I created a meta box with a dropdown list which consists of all existing categories. The administrator of the page should be able to choose one of the categories out of the dropdown list which will be saved by the save/update page function of wordpress. <code> &lt;select name="event-dropdown" onchange='document.locatio...
if you are using it in a metabox then you really don't need this part: <code> onchange='document.location.href=this.options[this.selectedIndex].value;' </code> So change the select fields to: <code> &lt;select name="event-dropdown"&gt; &lt;option value=""&gt;&lt;?php echo esc_attr(__('Select Event')); ?&gt;&lt;/option&...
pages meta box - get_categories dropdown
wordpress
I'm looking for Cutom Post Type Category List &amp; Post Count. Here is my code.. <code> &lt;?php $taxonomy = 'project-tags'; $tax_terms = get_terms($taxonomy); ?&gt; &lt;?php foreach ($tax_terms as $tax_term) { echo '&lt;li&gt;' . '&lt;a class="tag" href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="'...
<code> $tax_term-&gt;count </code> should contain the number of posts in the category. You may need to add the <code> $args </code> parameter if you want to include subcategory counts. Docs: <code> get_terms() </code>
Custom Post Type Category List & Post Count
wordpress
Just started reading Professional WordPress®: Design and Development I'm reading the section on "Advanced wp-config Options" . I see many options which I think are pretty cool/useful, but before I go crazy using "Advanced wp-config Options" I thought I'd inquire about "Best Practices" from the veterans in this area. I'...
There are no best practices: You just do what you need for your web site. These needs are different for each site, so the default is good enough for most sites. If you read the wp-config questions you’ll find some tricks and information. But I wouldn’t recommend anything for every site, not even for most sites.
What are "best practices" for wp-config.php
wordpress
I'm looking for a way to create an if...else statement hinging on whether pretty permalinks are active or not. So I need something which returns true when permalinks are changed from the default. <code> if (pretty_permalinks_are_on) { do this; } else { do that; } </code> Sort of thing. Just have no idea about the 'pret...
<code> get_option( 'permalink_structure' ) </code> is your friend. If you're using the default it will be set as an empty string: <code> if( get_option( 'permalink_structure' ) !== '' ) { // custom permalink enabled code } else { // no permalink } </code>
conditional statement for active permalinks
wordpress
I'm writing a Paypal Pro woo commerce extension to allow it to accept credit card directly on my websites. When I test things, everything works well. The only thing that I don't get is an email notification. So I would like to know does my gatway class need to send the receipt email or the internals of the WooCommerece...
WooCommerce sends the emails - triggered by the payment_complete method of the order class. By the way, WC has an official paypal pro extension: http://www.woothemes.com/extension/paypal-pro/ written by myself.
In woocommerce who is responsible for sending the receipt email?
wordpress
I jus want to create a gallery which shows either all or certain number of posts in that category under each post and i found a working code <code> &lt;?php $displayposts = new WP_Query(); //get posts from your news category $displayposts-&gt;query('cat=5'); while ($displayposts-&gt;have_posts()) : $displayposts-&gt;th...
Well first off, that code's a mess to read, some formatting would definitely help get you an answer. That said, here's the documentation on WP_Query and some sample code to boot <code> $args = array( 'post_status' =&gt; 'publish', 'tax_query' =&gt; array( array( 'taxonomy' =&gt; 'category', 'field' =&gt; 'slug', 'terms...
how to call the category of the post
wordpress
I found an amazing plugin that loads the next posts with Ajax. http://www.problogdesign.com/wordpress/load-next-wordpress-posts-with-ajax However it doesn't work with custom post types. The code looks fairly simple. Any idea how to edit the code to use custom post types? Thanks
In principal, you could use this with any archive page. All it's doing is fetching the next page of results and displaying the data. The reason it won't work with CPTs is because of the way the PHP script is queued - with an <code> !is_singular() </code> filter. The core of the plugin is in the JavaScript. Namely, this...
Load Next WordPress Posts With AJAX?
wordpress
i would like to know how to link the next and previous post of the current post with in that category..i tried lotta plugins put nothing worked out and I am a noob in WP so kindly help me
Here's a good place to start: http://codex.wordpress.org/Template_Tags/previous_post_link http://codex.wordpress.org/Template_Tags/next_post_link As you will see, keeping the links to posts of the same category is as simple as setting an argument in the function. I would give an example but there are really good exampl...
how to add previous and next link for the posts?
wordpress
On my test case, the page' title is "Privacy". The straightforward approach <code> strtolower(the_title()) </code> also returns "Privacy" -- still with a capital P. I also tried <code> mb_strtolower(the_title()) </code> and <code> mb_strtolower(the_title(), 'utf8') </code> with similar results. Not sure if it matters, ...
lowercasing the title If I'm understanding you correctly, you should be doing: <code> strtolower(get_the_title()); </code> or <code> print strtolower(get_the_title()); </code> if you want to display it. Below is an explanation as to why. the_title() vs. get_the_title() The function <code> the_title() </code> prints the...
How do I convert a page's title to lower case?
wordpress
I need some help with tabs in Wordpress. I tried several tab plugins for Wordpress, but none did what I wont. I tried Quick tabs, Hybrid tabs and SidebarTabs. I want sidebar to be like this: http://www4.slikomat.com/11/0116/q7a-tabs.png In fact these are basic tabs, with possibility to put content in it. Another questi...
Tabber Tabs Widget I'd been looking around as well, and this one seems to fit the goal. And no coding, all done with plugin/widget.
Tabs and Category Widget
wordpress
I would like to make my home page in such a way it shows the most viewed, random and recent posts by thre differents part by limitin the number of posts......give me at least some hints or idea to try it. Thank you in advance
I've implemented this before with custom queries and widgets. You have to be tracking all of these stats, of course, but if you are, it's a rather simple matter to build a widget that displays it and drop it in. If you're not using widgets, you can do the same, it will just take a bit more coding on your part, but use ...
how to show the most viewed, random and recent posts in the home?
wordpress
the post_author_meta_box uses wp_dropdown_users showing the user name of authors. How do I display the email address in brackets next the author's name? Can one filter the wp_dropdown users do to this?
the only filter hook called in <code> wp_dropdown_users() </code> function is <code> wp_dropdown_users </code> which pass a string of the dropdown in an html form so you can manipulate this dropdown at that hook with some major REGEX. A better solution would be to use get_users() and create the dropdown your self, some...
Display email address field next to author in wp_dropdown_users
wordpress
Is there a way to have "Pages" set as the default tab when the user logs in to the admin area? I am using a heavily customised set up, where none of the dashboard widgets are useful so they are hidden anyway.
The best way is to re-direct user logins to your page and also remove the dashboard from the menu, this can be done with 2 filters. Redirect logins to your page edit screen example based on user roles, this example uses "author": <code> function dashboard_redirect($url) { global $current_user; // is there a user ? if(i...
Remove dashboard, use Pages tab as default
wordpress
Hi making a simple plugin that replaces the wrong russian month with the right ones. But I can't find any filters that works. I have tried these filters without success: add_filter('get_the_modified_date', 'russian-month'); add_filter('the_modified_date', 'russian-month'); add_filter('date_rewrite_rules', 'russian-mont...
You can use <code> add_filter('the_time', 'your_function'); </code> or <code> add_filter('the_date', 'your_function'); </code> depending on which function you use in your theme.
Looking for a filter to modify the months
wordpress
I'm creating a cron job that runs outside of WordPress. From a development perspective, this makes it really easy to debug and create cleanup scripts or cron jobs, by just running a command like the following on the command line: <code> php myfile.php </code> My issue is that WordPress somehow delays all output... typi...
After some testing indeed, both WP Super Cache and W3 Total Cache do not release the buffer (or prevent the buffer from being released). Turning off "output delay" is simple and depends on the caching plugin involved. WP Super Cache : <code> wp_cache_disable(); ob_end_flush(); // or ob_end_clean(); </code> This should ...
Running WordPress on the Command Line - Turn off Delayed Output?
wordpress
I have been trying google for this, but not so easy to search for. I have a custom hierarchical taxonomy, something along the lines of: <code> Chainsaws - Electric - Petrol - Other Grasscutters - Electric - Petrol - Other </code> What I need to do is create an index page, retaining the hierarchical structure. The close...
<code> &lt;?php $args = array( 'taxonomy' =&gt; 'product-type', 'hierarchical' =&gt; true, 'title_li' =&gt; '', 'hide_empty' =&gt; false ); ?&gt; &lt;ul&gt; &lt;?php wp_list_categories( $args ); ?&gt; &lt;/ul&gt; </code> You can use the wp_list_categories function also for taxonomies. http://codex.wordpress.org/Templat...
Custom Taxonomy Tree view
wordpress
I have a list of events on a clients website that show in a sidebar. When viewing the homepage you see one event and if you're anywhere else on the site you see two events in the sidebar. I am currently ordering them by using a meta_query compare that checks if the event is today or in the future. What I would like to ...
This is just a shot in the dark but I would try ordering the events in descending order instead of ascending. <code> 'order' =&gt; 'DESC' </code>
Arrange Posts By Date In Order Of Closest To The Current Date
wordpress
What would be the best way to add some basic HTML to the page overview (edit.php)? Basically I want to add some text, like a meta box, to explain some things about the page system to my multisite users. Found the answer thanks to the solution provided by OleVik. Here's a few more resources on the topic: How to show an ...
I use a version of the following, to add text to the top of the Page ( edit.php?post_type=page ): <code> // Show message when viewing pages function page_AdminMessage() { showMessage("You are now viewing the Pages", false); } if ($_GET['post_type'] == 'page') { add_action('admin_notices', 'page_AdminMessage'); } </code...
Customizing the dashboard page or post overview
wordpress
I'm using WP 3.1.2 and latest e-commerce plugin. Now I'm stuck at creating simple page for printing product info. It has to be only product information with not WordPress header and footer. The pop up window appears nicely but now I need to check against something in header and footer files to when not to display them....
You can handle this much more simply with CSS and a print stylesheet . Just add <code> display:none </code> within that stylesheet for all elements you don't want visible in the print version.
How do display simple page for printing product info?
wordpress
OK, I am creating a business listing site that is using a custom taxonomy for the listing "type". I need to display two loops on the taxonomy archive page, one for "sponsored" listings and one for regular ones. taxonomy archive: http://pastie.org/3187162 pagination function: http://pastie.org/3187168 Both parts are doi...
The issue is that before your custom queries load, WordPress runs the main taxonomy query (all results in that tax term, 10 per page). On page 6, the main query is trying to load posts 51-60, and since they don't exist the page 404's before you have a chance to load your custom query. Customize the main query using the...
Pagination on 2nd loop
wordpress
I'm creating a single page site and obviously want to include the blog posts. I'm currently looping through the pages and using the_content() and the_title() to display them. However, the_content doesn't include the blog posts on the blog page. I tried another loop in this one, but it didn't work. Any ideas to point me...
To include posts and pages in the loop, use the 'post_type' argument: <code> &lt;?php $wp_query = new WP_Query(); $args = array( 'post_type' =&gt; array('post','page') ); $wp_query-&gt;query($args); while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the_post(); ?&gt; &lt;?php the_content(); ?&gt; &lt;?php endwhile; ?&g...
Single page site (Wordpress) including posts
wordpress
So I was looking into the update_user_option() as I need to update an additional field upon registration. So I found this in wp-login.php: <code> update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. wp_new_user_notification( $user_id, $user_pass ); </code> Somehow I'm no...
I think you need to use <code> update_user_meta() </code> , I may be misunderstanding what you're trying to do though. EDIT (doesn't work): <code> add_action( 'user_register', 'my_save_extra_fields' ); function my_save_extra_fields( $user_id ) { update_user_meta( $user_id, 'deposit', 5 ); } </code> EDIT: WORKING SOLUTI...
update_user_option not working as expected
wordpress
I need to include a file from plugin Folder in my template file. How can I do that? Is there any other way to do that rather than: <code> include('../../..'); </code> Thanks
<code> plugins_url( 'file_location/relative_to.plugin', 'plugin/file/location' ); </code> , or something along those lines at least, should do it for you. Alternatively, you could work from the top down and say something like <code> include( '/wp-content/plugins/you-plugin-name/file.php' ) </code> to get it, whichever ...
How to Include File from Plugins into Template?
wordpress
I'm trying to create a menu directly hard-coded, basically I need to display the parent category and below its child categories, however I have to do this several times meaning something like this: Category 1 category child of 1.1 category child of 1.2 category child of 1.3 Category 2 category child of 2.1 category chi...
Have you tried <code> wp_list_categories( array('depth'=&gt;2,'title_li'=&gt;null)); </code> This outputs the categories as a list, with their children as a nested list. The categories are linked to their respective page.
Categorie parents and childs displayed
wordpress
I'm trying to get a video to display inside a widget which is called from a custom field inside a post. The code I am using is here: <code> &lt;?php query_posts('cat=8&amp;showposts=1'.get_option('posts_per_page')); ?&gt; &lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;&lt;?php if( get_post_meta($pos...
<code> query_posts </code> is for modifying the main loop only, if you're doing additional queries outside of or within the main loop, create a new WP_Query instance. also- I'm not sure why you have <code> showposts=1 </code> and then <code> get_option('posts_per_page') </code> immediately after. If for example <code> ...
Displaying a video on the homepage via a custom field inside a php widget
wordpress
My site's menu uses the built-in menu under Appearance > > Menus. I want to make a very simple change: I want to wrap each of my menu's second-level ULs in a DIV. What's the simplest way to accomplish this?
Use a stackexchange-url ("custom walker"). Extend the functions <code> start_lvl() </code> and <code> end_lvl() </code> : <code> class WPSE39005_Div_Walker extends Walker_Nav_Menu { /** * @see Walker::start_lvl() * * @param string $output Passed by reference. Used to append additional content. * @return void */ public ...
Manipulating menu HTML
wordpress
I am using this code to get posts of specific taxonomy. It displays 10 posts by default. How can I set my own limit? <code> &lt;?php $count = 1; $the_query = new WP_Query( array( 'brand' =&gt; 'sony-vaio' ) ); while ($the_query-&gt;have_posts()) : $the_query-&gt;the_post(); ?&gt; </code>
To display 5 posts, say, use <code> posts_per_page </code> . See the Codex. <code> $the_query = new WP_Query( array( 'brand' =&gt; 'sony-vaio','posts_per_page'=&gt;5 ) ); </code>
Limit number of posts in wp loop
wordpress
I am trying to create a post type which only displays the Media Library Inline. I have got the example from this : https://gist.github.com/897503 However, nothing happens when I click "Insert Gallery". The code is as below. Thanks in advanced! <code> add_action( 'init', 'create_post_type_gallery' ); function create_pos...
Take a look at my Gallery Metabox plugin to see how to build one, or you could just use the plugin itself. There's a filter for specifying the post types it applies to.
How to display a custom post type's media library inline on meta box
wordpress
Tripadvisor offers a free wordpress theme at here If you go on this page, you'll see the free wordpress theme, and on the navigation bar, there is the trip advisor logo on the right, How can I remove this logo because i have many menu items?? By the way can i remove it not specified nothing as rules and regulation??
If you open header.php and remove line 96: <code> &lt;a class="ta-bug" title=" TripAdvisor " href="http://tripadvisor.com"&gt;&lt;img src="&lt;?php echo get_stylesheet_directory_uri(); ?&gt;/images/TA_bug.gif"&gt;&lt;/a&gt; </code> , it will be gone. I cannot speak to the legality of this with certainty, but by my unde...
How to remove the tripadvisor logo from the wordpress theme?
wordpress
I wrote a simple plugin that will redirect the users to a page on a certain date. (in this case it's for the Blackout against SOPA here in the US) Right now I'm using the line <code> wp_redirect(plugins_url( 'simple-sopa-blackout/blackout.php'),302 ); </code> to redirect the users on the given date. The problem is it m...
I think this answer could help you. Make a custom page template within your plugin and then create a page with that template called Blackout, and redirect users in the plugin to that page. Help from: stackexchange-url ("Create custom page templates with plugins?") Edit with code sample: Say you have a page called Black...
How to Create a Custom Plugin Permalink
wordpress
i am looking for a most commented plugin like that of in engadget website and propakistani . I would be very thankful if someone could help me out with it. Thanks
You could use a plugin like http://wordpress.org/extend/plugins/wordpress-popular-posts/ to get a widget based on popular posts (I've never personally used that one) or write your own. Everything else is just HTML markup and CSS.
Engadget Like most commented plugins
wordpress
I have a simple contact form that I set up to display on multiple pages using a shortcode and a widget but since I need to form to post back on the same were it's displayed I'm not sure how to accomplish this. I was thinking about writing a function and plug it to the <code> wp_head </code> hook but I'm not sure if it'...
Kind of - I would suggest using <code> init </code> . This would probably be the best way of doing it since you can process the form as described below. <code> wp_head </code> would work though. Also, you should make sure you are making necessary checks with 'nonces'. I suggest the <code> init </code> hook as you can e...
how to handle forms in multiple pages?
wordpress
With shortcodes that have only one attribute, it would be much easier from a content-editing perspective to use, for example, <code> [icon="myicon"] </code> instead of <code> [icon whichicon="myicon"] </code> . Is this possible in Wordpress? Is it problematic?
I thought this was a rather good question, so I tinkered with it a little. It seems as though the catch to using the direct method ( <code> [icon='myicon'] </code> ) vs using an attribute is that with the direct method, you cannot use spaces as it will split to separate attributes, even if you use quotation marks, and ...
Use [shortcode="value"] instead of [shortcode att="value"]?
wordpress
I have a custom post type called Testimonial that includes custom fields "name", "title" and "bank". I would like to display each of these items on a page. Here's what I have so far: <code> &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); the_title(); echo '&lt;div class="entry-content"&gt;'; the_conte...
<code> &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); the_title(); echo '&lt;div class="entry-content"&gt;'; the_content(); echo '&lt;/div&gt;'; echo '&lt;div class="custom-field"&gt;'; echo get_post_meta( get_the_ID(), 'name', true ); echo get_post_meta( get_the_ID(), 'title', true ); echo get_post_...
How can I display the parts of custom posts?
wordpress
I'm writing a plugin that needs to display a custom link immediately near the comments. I have the option in the plugin admin to display before or after. I'm familiar with the comments_array, but that doesn't allow me to just add a string of html just before the comments or just after the comments but before the commen...
<code> do_action( 'comment_form_before' ); </code> is called on line 1553 of /wp-includes/comment-template.php, right before the output of the comment form, that should handle that one for you. I'll update this if I can find the hook before the comments. edit It seems like you might be able to modify Walker_Comment (fo...
Hook/Filter before and after comments
wordpress
I'm trying to create child theme for theme i'm using on my site... I read lot's of articles about this, but can't find simple tutorial or simple explanation how to do it... As i understand so far, if i copy (for example) loop.php file to child theme, and change <code> if(is_home()) { do something } </code> from origina...
You are correct. The child theme would over-ride the parent theme's loop.php if you made changes. As for a simple tutorial I did a simple Google search, after a quick overview this one seems pretty simple: http://op111.net/53/ . Just in case you haven't been there, here is the WordPress Codex Page .
simplified explanation on child themes?
wordpress
I want to run some code on comment status change so using the action <code> wp_set_comment_status </code> but it seem to never fired when comment status gets changed. I am using wordpress 3.3.1. Here is a simple code which doesn't work for me: <code> add_action('wp_set_comment_status ', 'update_business_rating_avg'); f...
Your code is showing an empty space in the hook name <code> add_action('wp_set_comment_status ', 'update_business_rating_avg'); ^ </code> try removing it <code> add_action('wp_set_comment_status', 'update_business_rating_avg'); </code>
action wp_set_comment_status never gets fired when i change the comment status
wordpress
I've uploaded an image to my directory (themes/themename/images/file.png). I want this image to be displayed even if the directory preceding themes is changed (in case someone installs wordpress in a directory other than the home directory). What is the call I need to find the image? Simply using img src="/images/file....
<code> &lt;img src = "&lt;?php bloginfo('stylesheet_directory');?&gt;/images/file.png" /&gt; </code> http://codex.wordpress.org/Function_Reference/bloginfo
Add images to my theme with html
wordpress
I've got a Wordpress MU install in a sub-directory of my webserver. When I point my virtual host at that directory I get my index page but no styling or access to any pages. It's like it can't access anything in the sub-directories of my WP root, I get the 500 error. When I check the Apache log it says, "Request exceed...
You should have a look at this: stackexchange-url ("Request exceeded the limit of 10 internal redirects due to probable configuration error.?") and RewriteRule Flags It seems that you have a recursion in there. It is probably the last rule as the dot without anything else will match index.php as well.
500 error when using virtual host
wordpress
On a site I'm designing (business site versus blog - static homepage, etc.) for a client I have 7 different top -level product/service pages which have the same layout except for a graphic that stretches across the top, below the horizontal navbar and above the page content. Everything up to and including the navbar wi...
You're looking for the function is_page() You could use the page id, the title or the slug in the function. <code> &lt;?php if ( is_page('services') ) : ?&gt; &lt;img...services &lt;?php elseif ( is_page('customer') ) : ?&gt; &lt;img...customer &lt;?php else : ?&gt; &lt;img..default &lt;?php endif; ?&gt; </code> Anothe...
Way to use one template but be able to call different top graphics?
wordpress
I have a portfolio custom post type with a text field for a site link, I need to echo that link in the template page. What i have so far is this: <code> &lt;?php $site= get_post_custom_values('projLink'); if($site[0] != ""){ ?&gt; &lt;span&gt;&lt;p&gt;&lt;a href="&lt;?php var_dump($site); ?&gt;"&gt;Visit the Site&lt;/a...
I think you can better use get_post_meta() ; Your code will look like this: <code> &lt;?php $site = get_post_meta(get_the_ID(), 'projLink', true); ?&gt; &lt;?php if(isset($site) &amp;&amp; $site != "") : ?&gt; &lt;span&gt;&lt;p&gt;&lt;a href="&lt;?php echo $site; ?&gt;"&gt;Visit the Site&lt;/a&gt;&lt;/p&gt;&lt;/span&gt...
get post custom value
wordpress
(Cross-posted from stackexchange-url ("stack overflow")) I am building a WordPress plugin. The plugin works beautifully on one site. But on every other site I've tried so far one of the resource files used it getting a 404 (Not Found) error in the console. If I post the url, displayed in the console as not found, in th...
See the Codex page on using AJAX in Plugins properly and use wp_localize_script to pass data from php to javascript.
On one of my sites a file is shown as 404 but the file IS there
wordpress
Someone has asked me to analyze if his theme is 'good'. I've decided to analyze it in terms of number of assets that the theme needs compressing those assets ensuring wp_enqueue_x is being used ensure that loops are properly coded Am I missing anything important and obvious? I'd love to know what else you may think of,...
First of all - "good" is a bit vague a term.. Good for what ?? IF you mean technically valid , there are SOOOO many items to check, that you can fill a whole website with it . Those items also depend on personal preferences and are not always objective AND are changing with time . If you mean "efficient" as in resource...
What causes a theme to be inefficient?
wordpress
I have noticed that on the admin screen for viewing custom taxonomies that WordPress does not seem to save the 'show on screen' screen option. Upon changing it and clicking apply, the screen reloads and the value is back to 20. This does not occur with the WordPress built-in categories and tags. Only custom taxonomies....
It's a bug: http://core.trac.wordpress.org/ticket/18958
'Show on screen' for custom taxonomies does not save
wordpress
I'm using the following code: <code> &lt;?php if (the_post_thumbnail()) : ?&gt; &lt;div class="thumbnail"&gt; &lt;?php the_post_thumbnail('thumbnail'); ?&gt; &lt;/div&gt; &lt;?php endif; ?&gt; </code> But the thumbnail is appearing full size. Same applies if I use <code> (array(200,150)) </code> . My "Media" settings a...
Updated the answer to match my latest comment: Changing <code> &lt;?php if (the_post_thumbnail()): ?&gt; </code> to <code> &lt;?php if (has_post_thumbnail()): ?&gt; </code> will probably solve things. Also, some must have developer plugins when working with featured images: Regenerate Thumbnails AJAX Thumbnail Rebuild
the_post_thumbnail not resizing
wordpress
I just move my server to Mac server before I use to be with GOdaddy was no problem updating framework of my theme now I'm getting this error <code> Failed: Filesystem preventing downloads. ( ftpext) </code> not sure why but I've put this code in wp-config.php already <code> putenv('TMPDIR=' . ini_get('upload_tmp_dir'))...
Just add this line in your <code> wp-config.php </code> : <code> define( 'FS_METHOD', 'direct' ); </code>
Failed: Filesystem preventing downloads. ( ftpext)
wordpress
I'm looking for a way to filter the "Read More" link so I can append a second link and text. I know how to filter the text but not the entire output, eg: Standard post excerpt before the more quicktag.... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut auctor ligula. Vestibulum ac lectus quis nisl t...
You need to hook into <code> excerpt_more </code> filter, for more information see Codex page, as examples of use Twenty Ten 's and Twenty Eleven's function files.
Append Second Link to Read More
wordpress
In case there's more than one function the exact one is: php the_excerpt(); I want to decrease the character length to X amount and I want to remove the [...] and replace it with an image that users can click to take them to the article. How do I accomplish this (preferably without plugins)?
You need to hook into two WordPress filters. <code> function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); </code> http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_length <code> function custom_excerpt_more( $more ) { return '[.....]'; } add_...
Two "the_excerpt" questions
wordpress
I was certain that WordPress had built in a basic audio player. Am I mistaken. I cant find any evidence of one anywhere, just plugins ?
WordPress does not have a built-in audio player. You will need to use one of the myriad audio-player Plugins available.
Built in audio player?
wordpress
Is there a list of WordPress CSS id/classes that i can use to build plugin option screens that look and feel more like a normal WordPress option page? i have found some through serendipity but it would have been nice to ahve a list. An example is this class: button-primary That makes a button look like this:
We're working on updating http://dotorgstyleguide.wordpress.com/ to have more of this information and reflect the style updates from 3.2. Other than that, I've seen a plugin (that I currently cannot locate) that shows a demo page of sorts that displays the various CSS selectors and what they look like, but I believe it...
What are the standard admin CSS id/class tags?
wordpress
Check this url ( www.linuxstall.com ). The top navigation bar has one page (about us). I want the categories there, not pages. How can I do that?
If you are using the nav menus you can just add specific categories from your administration panel in Apperence-> menus. If you don't see the categories box open "screen options" and check them to display. If you want dinamicly add them you will need to write a plugin.
Using categories on navigation bar instead of pages
wordpress
At the moment I am working on a WP-site, which on the frontpages has 3 excerpts of other pages on it. The code I am trying to use for this is as following: <code> &lt;?php query_posts(array('post_type' =&gt; 'page', 'include' =&gt; 5, 7, 52, 'showposts' =&gt; 3) ); ?&gt; &lt;?php if ( have_posts() ) : while ( have_post...
Yes, use "post__in", a example: <code> &lt;?php $ids = array(5, 7, 52); query_posts(array('post_type' =&gt; 'page', 'post__in' =&gt; $ids, 'showposts' =&gt; 3) ); ?&gt; </code>
query_posts doesnt show pages with given ID when post_type => page
wordpress
There seems to be something wrong with the simple function below, but I can't figure out what it is. It is displaying as the following and I can't figure out why. I know it has something to do with the functions the_ID(), the_title(), and the_permalink(), but I don't know what it is. Sorry if this sounds like a silly q...
The insideds of a function is separated from the global things. Therefore the variables, set by other processes are not reachable/useable inside a function until you made them so, with, for example <code> global </code> keyword for a var. So Add <code> the_post(); </code> after the function's {, or add <code> global $p...
Post variables not displaying correctly in custom function
wordpress
The plugin Advanced Permalinks breaks the RSS feed since Wordpress version 3.1. The developer has stopped working on the plugin, and I haven't seen any solution for it. Since my site is dependent on the plugin I can't just disable it either. Does anyone know of a way to either generate a feed differently, or of a simil...
Fixed this now, answering for anyone googling. In a recent version of Wordpress the Permalink functionality has had quite an overhaul, making Advanced Permalinks unnecessary, at least in my use case. More info here.
Advanced Permalinks plugin breaks RSS
wordpress
I'm using the Roots theme which with custom css. I'm using the page "Home" as the front page the page "Blog" as the blog page (in WP reading settings) I'm trying to set the front page "Home" to use the template "full-width", but instead Wordpress ignores this and uses the "front page" template. This only happens on the...
This is by design - check out <code> wp-includes/template-loader.php </code> to see why. Delete <code> front-page.php </code> and it will fallback to the page template.
Wordpress ignoring specified template for front page. Why?
wordpress
I have a product section on my wp-site. I am trying to display the attached thumbnail image in specific sizes that are automatically cropped to the right size. I have used Advanced Custom Fields to create a field called product_thumbnail I have used Additional Image Sizes to create a new image size called products I ha...
why OH WHY does everybody insist on making custom fields for everything . is there a special reason that you would want the use of custom fields ? If so, please explain exactly what you want to achieve . If not - a much better approach (and more fool-proof for non-computer-savvy-clients) would be to use <code> the_post...
Trying to use Advanced Custom Fields with custom image sizes
wordpress
I have mainly protected categories, but I have one open category, how can I set it up so I load only the open catgeory posts to show on my home page
This should about do it for you, add args as needed <code> $args = array( //basic post data 'posts_per_page' =&gt; 10, 'post_type' =&gt; 'post', 'post_status' =&gt; 'publish', //category 'category_name' =&gt; 'your-cat-slug' ); $posts = new WP_Query( $args ); </code> Docs: <code> WP_Query </code>
How do I use just one category' posts on my home page?
wordpress
I have a taxonomy link in my admin sidebar i'd like removed from view. Only in the sidebar though, i will still be using the function in the post view, so if that creates problems a simple simple CSS trick will do. Just need it gone from the sidebar as it's unnecessary clutter. The current link looks like: http://domai...
<code> function remove_featured_tax_menu() { remove_submenu_page( 'edit.php?post_type=movies', 'edit-tags.php?taxonomy=featured&amp;amp;post_type=movies' ); } add_action( 'admin_menu', 'remove_featured_tax_menu' ); </code>
Remove Admin sidebar link
wordpress
Check this URL www.linuxstall.com . The top navigation bar has one page (about us). I want the categories there, not pages. How can I do that?
Assuming you're dealing with a recent version of Wordpress it should be pretty straightforward. In your Wordpress admin panel, select Appearance-> Menus. Create a new menu. In the current wordpress there's a little plus sign at the top, enter a new menu name, and then click create menu. On the bottom left there should ...
Using categories on navigation bar instead of pages
wordpress
Any ideas? I've never had this problem before. Here is the site.
It looks like your site is doing a lot of processing when displaying a page. have you tried adding a caching mechanism? you can give plugin a try: http://wordpress.org/extend/plugins/w3-total-cache/
Why does my site flash white every time it changes page?
wordpress
So I'm trying to use a session to move a variable through pages. For some reason I literally cannot access anything from index.php to archive. I declare my session at the very top of my header.php like: <code> &lt;?php if(!isset($_SESSION)) { $_SESSION['catID'] = 3; } ?&gt; </code> Then I move to the archive.php which ...
In WordPress you need to start the session with <code> if ( !session_id() ) { session_start(); } </code> in order to use session variables. You can enter this code into wp-config See http://www.frank-verhoeven.com/using-session-in-wordpress
Can't Access Sessions or Variables through pages
wordpress
I have a couple issues with the way Wordpress handles redirects on login and logout. Standard behaviour is: <code> login: /wp-login.php (with no redirect_to url) -&gt; /wp-admin.php logout: /wp-admin.php -&gt; /wp-login.php </code> What want is: <code> login: /wp-login.php (with no redirect_to url) -&gt; homepage logou...
This really does belong in a plugin, but you can just as easily drop it in your theme's <code> functions.php </code> <code> function default_login_redirect( $redirect, $request_redirect ) { if ( $request_redirect === '' ) $redirect = home_url(); return $redirect; } add_filter( 'login_redirect', 'default_login_redirect'...
handling login/logout redirects
wordpress
I would like to remove or hide the Biography input field from the profile page. How do you do this? I already removed some contact methods from this page, but I'm not sure how to get rid of the biography.
There is no dedicated hook – user management is a low priority in WordPress. You have to use output buffering (yes, not nice). Here is a simple demonstration how this could be done: <code> add_action( 'personal_options', array ( 'T5_Hide_Profile_Bio_Box', 'start' ) ); /** * Captures the part with the biobox in an outpu...
How to remove Biography from user profile admin page
wordpress
this is pretty straight forward: How do I redirect mobile users to /mobile, but still allow them to click a "Full site" button and see the full site without being redirected again back to the mobile site? I have played with a bunch of the plugins that say they do this, but none seem to handle the second step. They redi...
<code> function mobile_redirect() { if (isset($_COOKIE["redirected"]) &amp;&amp; $_COOKIE["redirected"]) return; global $is_iphone; if( isset($is_iphone) &amp;&amp; $is_iphone ) { wp_redirect( '/mobile/' ); setcookie("redirected", true); exit; } } add_action('init', 'mobile_redirect'); </code> This code redirects every...
How can I redirect mobile users to diff url, but also allow them to come back to full site
wordpress
In wordpress 3.2 when uploading images to a post, I would get a Gallery that is linked to the post. That is, I could see in the media uploader of the post a tab that contains only the images of this post, and there would be a place to mark the order of the images I wanted for the post. In wordpress 3.3 I can only see t...
As far as I know, media management didn't change from WP 3.2 to 3.3 (except for replacing the uploader itself with PLuploader). It has always been possible to upload images directly to the media manager (by uploading via Dashboard -> Media Library ), in which case such uploaded images would not be attached to any parti...
How to order images in a post in Wordpress 3.3?
wordpress
I have installed a theme on WordPress added pages, created a custom menu called Primary Nav. I have then assigned this as my Primary Menu. I have child pages and the menu looks like this. I have looked at the WordPress resources to find a solution but it seems as though I have followed the instructions on creating drop...
Without seeing your code it's hard to say what you should do to fix it. The code you've supplied is the html output not the PHP code right? stackexchange-url ("Take a look at one of my previous answers"). Make sure you use the Updated for Edited For WordPress 3.3 Compatibility section of the answer. If you're still uns...
Dropdown primary navigation menu not working
wordpress
So I have a css file that is called <code> blue.css </code> and a universal one called <code> style.css </code> I have a few css colors inside a <code> /css </code> folder. How do I get all those css files to show up in my Admin panel editor?
Use the <code> add_editor_style() </code> function in your functions.php: <code> add_editor_style( 'css/blue.css' ); </code> You can call that function multiple times to load additonal stylesheets in to the admin editor.
Get Stylesheet To Showup in WP Admin Panel Editor
wordpress
I am using the Options Framework Theme from devinsays, but am having a "small" problem with the Image Upload functionality. Basically, I need to disable resizing on a specific upload-field, but keep it on all others. I do realize that this functionality is not specifically dependent on this framework, but I haven't bee...
WordPress will always create the additional images for "thumbnail", "medium" and "large" sizes. The options panel doesn't add an additional size- it just resizes the one you've selected using CSS. If you want to override that CSS you can hook in an additional stylesheet that will override the id on that option.
Disable image resizing on specific upload fields
wordpress
Is is possible to make WordPress auto-save revisiona more often and have the auto-save version always be the most recent version - Like the way google docs works. This would mean the update button is not necessary. you visit a post or custom post type, make your change, then click to another part of the admin, and your...
Set custom autosave interval Just define it in your wp-config.php file <code> // Allow revisions define( 'WP_POST_REVISIONS', true); // Set number of ms define( 'AUTOSAVE_INTERVAL', 300 ); </code> Note that this means that you'll get a lot of queries and post revisions. Therefore you should also add a max. number of re...
WordPress as a web app - always auto-save post and meta data
wordpress
On my site I have some posts with a custom field "Name". Now, in case the post has "Name" set, I want to generate this code: <code> &lt;script type='text/javascript'&gt; var FG_DONATE_BUTTON_PARAMS = { attribution: 'honor', attribution_name: Name} &lt;/script&gt; </code> where Name after attribution_name refers to the ...
You may wish to look at stackexchange-url ("this question"). In that question, the admin-ajax url is passed through, but it can be any variable (or array of variables), like for instance <code> $nameAttribute </code> . For instance, you would call <code> wp_localize_script('my_js_file_handle','my_js_object',array('attr...
What is the "proper" way to generate a javascript variable depending on a custom field value?
wordpress
I am trying to add a page to WordPress programatically. I am using this code: <code> function add_media_page(){ if(!(is_page('My New Post'))){ // Create post object $my_post = array( 'post_title' =&gt; 'My new Post', 'post_content' =&gt; 'This is my post.', 'post_status' =&gt; 'publish', 'post_author' =&gt; 1, 'post_ty...
'post_type' => ['page'] is wrong; it should be 'post_type' => 'page'
Programatically add a page in Wordpress
wordpress
So I have a custom post type called <code> Video </code> and a taxonomy called <code> category </code> that I use to group videos togheter, so I want to list them like this: <code> Taxonomy NAME 1 VIDEO 1 VODEO 2 Taxonomy NAME 2 Video 1 Video 2 </code> So I tried something but it doesn't work, the problem is that for e...
Okay, so first off, I would rename your video category to something like <code> video_category </code> so it doens't conflict with the built in <code> category </code> . That said, the easiest way I could think to demonstrate this for you was with a shortcode. Some initial prep, set up post types (for demonstration, de...
How do I display a list showing custom post types nested within a taxonomy?
wordpress
So I'm working with a non-wordpress theme called "Misty" and it uses this code to pull categories: <code> &lt;li class="sidebox"&gt; &lt;h3&gt;&lt;?php _e('Categories','ml'); ?&gt;&lt;/h3&gt; &lt;ul id="catList"&gt; &lt;?php if (function_exists('wp_list_categories')) { wp_list_categories("show_count=1&amp;include=$catI...
The child ul comes with the class "children", so you can use this to target your css. <code> ul.children li { } </code> Even without that, though, you could just use the hierarchy of lists to target.. <code> ul#catList ul li { } </code> would target any li within a ul, within the #catList ID.
Differentiate Between Parent & Child Categories
wordpress
I have built and maintain many themes for various clients. I'd like to be able to put them all in github for lovely version control. However github gets a bit expensive when you have over 20 private repositories. I'm going to have about 30+. The themes are not used together, each one is for a separate client. I know I ...
You have to use branches (git can stackexchange-url ("clone single branch") from repo) in case if you'll stick with Github If you can think about using hosted Git outside Github, you can select Assembla with Git and, f.e, Starter Plan ($9), it which you'll get one (private) space and unlimited independent repos in spac...
How to use one git (github) repository for version control for multiple themes
wordpress
I want to know if this site can be built with wordpress, I'm a programmer and I don't know anything about wordpress, how I'm just to get some good advices from you guys: The main aim of the site is to allow users to view several places of interest in a country Administrator: -create a place of interest - add,delete,edi...
Short Answer Yes. Theoretically any site can be built on top of Wordpress. Long Answer You are going to need a lot of modifications to the standard Wordpress theme. But not to fret I have assembled a list of some of the things that you would need to do to get your feet wet. Add Custom Post Type for Places (Guide | Plug...
Can this site be built using wordpress?
wordpress
So I have a custom post type called <code> Video </code> and a taxonomy called <code> category </code> that I use to group videos togheter, so I want to list them like this: <code> Taxonomy NAME 1 VIDEO 1 VODEO 2 Taxonomy NAME 2 Video 1 Video 2 </code> So I tried something but it doesn't work, the problem is that for e...
As per Anand's comment, something like this should work. <code> &lt;?php get_header();?&gt; &lt;?php $args = array( 'post_type' =&gt; 'Video'); $loop = new WP_Query( $args ); $old_term = null; while ( $loop-&gt;have_posts() ): $loop-&gt;the_post(); $fg = get_the_terms(get_the_ID(),'category'); foreach($fg as $term): if...
Wordpress custom post type and taxonomy
wordpress
I have read countless posts on ordering data by numeric value ( as opposed to string - it i have a numeric meta value and it gets ordered like this 1 11 12 2 233 etc as opposed to the way i want it I am using WP_Query have tried using meta_query => 'NUMERIC' but i'm not sure if that's what it's actually supposed to do ...
you need to use <code> 'orderby' =&gt; 'meta_value_num', </code> also if you are ordering dates, the best advice is to put them in an easy to order way such as 2012-12-31
order by numeric value for meta value
wordpress
After performing a WordPress upgrade to 3.3.1, I can no longer access the administration interface. The website works fine, but when I click on Dashboard, I receive the following error: Fatal error : Call to undefined function _wp_admin_html_begin() in /home/a7938356/public_html/wp-admin/admin-header.php on line 40 ......
It most likely was a bad upgrade. You should manually download the latest WP version and overwrite all directories except wp-content. Your wp-config.php file won't be overwritten. This should fix the issue.
After upgrading WordPress, can't access admin interface
wordpress
I've tried a number of plugins including Add Meta Tags and Meta SEO Pack which add a meta tag description to the home page. But my home page is static so the description is added to my blog page. I know I could add them manually but are there any plugins do this? Thanks
For anyone using Thematic, the thematic_create_description() filter worked nicely.
Add meta tags with a plugin?
wordpress
I am trying to find some way when using <code> WP_Query </code> of ordering by multiple meta_values. I know I can order by multiple values and I know how to order by meta_values but I cant seem to figure out how to do multiple meta_values. Is it possible ?
you can also store it like yyyy-mm-dd and and use <code> $date_array = explode( '-', $date_string ); </code> to make it into an easy to manage array. or even better change it into a unix timestamp with <code> $unix_time = strtotime( $date_string ); </code> php loves to work with unix time stamps, it's the native format...
How to order by multiple date meta_values?
wordpress
I was trying to add some text to the beginning of every post (the text comes from <code> post_meta </code> , but for this example let's assume it's static text). Here's what I tried: <code> add_filter('the_content', function($content) { return 'Text from meta - ' . $content; }); </code> However, if the post starts with...
I finally settled on using a regex, with a limit of 1 so it only happens on the first paragraph: <code> add_filter('the_content', function($content) { $content = preg_replace('/&lt;p[^&gt;]*&gt;/', '$1Text from meta - ', $content, 1); return $content; }); </code>
How to prepend text to the_content, but after img/shortcode
wordpress