Echoing a variable inside a function

In the interest of automation, instead of making a long list of code like this
Facebook URL<input  type="text" name="Facebook" id="Facebook" size="52" value="<?php echo get_option('Facebook_url'); ?>"/>

      I'd like to echo all of that out from PHP to generate the page. I have build an array containing all the social networks, twitter/facebook etc. As of now, this can read the saved settings but does not allow it to save new inputs.               function display_settings_fields($value,$key){     $keyurl = $key.'_url';     echo "The key $key has the value $value
";     echo '
'.$key .'URL<input  type="text" name="'.$key.'" id="'.$key.'" size="52" value="';     echo get_option(''.$keyurl.'');     echo '"/>

';              }         $social_icon_set = array(         "Twitter" =>"$twitter_url",         "Facebook" =>"$facebook_url",         "GooglePlus" =>"$googleplus_url",         "Yelp" =>"$yelp_url",         "Youtube" =>"$youtube_url",         "Vimeo" =>"$vimeo_url",         "Flickr" =>"$flickr_url",         "Tumblr" =>"$tumblr_url",         "Picplz" =>"$picplz_url",         "Foursquare" =>"$foursquare_url",         "RSS" =>"$rss_url",         "Behance" =>"$behance_url",         "Goodreads" =>"$goodreads_url",         "Github" =>"$github_url",         "Formspring" =>"$formspring_url",         "Myspace" =>"$mypsace_url",         "Klout" =>"$klout_url",         "Diaspora" =>"$diaspora_url",         "LinkedIn" =>"$linkedin_url"         );         array_walk($social_icon_set,"display_settings_fields");         ?>      The problem comes about with the "echo get_option(''.$keyurl.'');. Right now, its echoing the correct value, the saved value for it, but it does not allowing saving of anything edited in the text field. Is this even possible to echo/print this out, where its savable. (This is mostly PHP but if there's another way around this, because it is using wordpress's get_options, im open to ideas)


Add Login and logout buttons to top menu bar

I got this code to insert menu bar in the PRIMARY menubar, but I can not find a way to insert it into my secondary, or top menubar above the primary menu bar. Could anyone teach me how to do that?               add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );     function add_loginout_link( $items, $args ) {         if (is_user_logged_in() && $args->theme_location == 'menu_top') {           $items .= '
Log Out
';         }         elseif (!is_user_logged_in() && $args->theme_location == 'menu_top') {           $items .= '
Log In
';         }         return $items;     }      =============Additional Info============== I am using Custom Community Theme 1.4. Just in case it will be helpful, and **I tried to use 'menu_top' as keyword rather than primary, but it does not work, it originally was primary!** ==============MORE INFO==================== Ok, in request, I found more info, but as I tried, menu_top does not work, and seem these code already tell what is the name of the menu, is that right?               // This theme uses wp_nav_menu() in one location.         register_nav_menus(array(             'menu_top' => __('Header top menu', 'cc'),             'primary' => __('Header bottom menu', 'cc'),         ));


WP_Query in a shortcode

I am trying to put several queries in a shortcode so that I can call them in a page instead of using custom templates. I got my query going but I only see some of the content on the page. The image shows up, the text shows up but none of the html markup is showing up. Is there a Wordpress function that I need to pass this all through so it doesn't strip the HTML?               function band_query($atts) { ?>
         <?php                                    extract(shortcode_atts(array(             "category" => '',             "number" => ''         ), $atts));              $band = new WP_Query( array(             'category_name' => $category,             'posts_per_page' => $number         ));         $output = '';         // The Loop         if( $band->have_posts()):             $output .= '
';             $output .= '
';             while ( $band->have_posts() ) : $band->the_post();                  $output .= '
';                 $output .= '
' . the_post_thumbnail('band', array('class' => 'left marg_right1')) .'
';                 if ( has_excerpt()){                     $output .= the_excerpt();                 } else {                     $output .= the_content();                  }                                                    $output .= '
  Read More
';                 $output .= '
';             endwhile;          endif;         wp_reset_postdata();         $output .= '
';              $output .= '
                                     $output = apply_filters('the_content', $content);            return $output;          }     add_shortcode("band_page", "band_query");


How to enable parent-child relationships and post attribute admin widget for posts

I want to be able to select a parent post when i create a new post. I assume it should be easy just to make the 'page attributes' admin widget to work similarly for posts too. The use case is for this site: thedevs.org where i want to enable people to post projects then later on make new posts that are children to a project post and would be listed under the parent post. I am slightly new to wordpress but i play around with php quite easily. A working plugin or code snippet would help.


eaccelerator PHP error

I installed a Wordpress plugin and I'm getting the following error. The weird thing is I checked the plugins' source and I really don't understand why it would need those scripts. > [30-May-2011 11:10:03] PHP Warning: PHP Startup: Unable to load dynamic > library '/usr/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so' > - /usr/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot > open shared object file: No such file or directory in Unknown on line 0 > [30-May-2011 11:10:03] PHP Warning: PHP Startup: Unable to load dynamic > library '/usr/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so' - > /usr/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: cannot open > shared object file: No such file or directory in Unknown on line 0 This is the plugin: http://wordpress.org/extend/plugins/upprev-nytimes-style- next-post-jquery-animated-fly-in-button/


Adding custom widgets to theme sidebar on activation

I have a custom widget in my theme with the id of "widget_my_box_menu" and I'm trying to add that widget to my theme's main sidebar on theme activation. The main sidebar's id is "home-sidebar-widget" When I activate the theme, the widget_my_box_menu is added to the "Inactive Widgets" collection instead of the "home-sidebar-widget" Any ideas what I'm doing wrong?               function my_default_theme_widgets ($old_theme, $WP_theme = null) {                 $new_active_widgets = array (                     'home-sidebar-widget' => array (                             'widget_my_box_menu',                     ),             );                  // save new widgets to DB             update_option('sidebars_widgets', $new_active_widgets);                  //widget title             update_option( 'widget_my_box_menu', array( 'title' => 'Recent Articles' ));          }     add_action('after_switch_theme', 'my_default_theme_widgets', 10, 2);


New post status for custom post type

I have a custom post type `recipes`. I am using a cron script to automatically aggregate news into the database. It is currently being imported and saved as 'Pending Review'. Is it possible to create another post status called `Aggregated` which will list all of the aggregated news to be published? I tried using the `register_post_status` function, however this didn't seem to work:               function custom_post_status(){         register_post_status( 'aggregated', array(             'label'                     => _x( 'Aggregated', 'recipes' ),             'public'                    => false,             'exclude_from_search'       => true,             'show_in_admin_all_list'    => true,             'show_in_admin_status_list' => true,             'label_count'               => _n_noop( 'Aggregated (%s)', 'Aggregated (%s)' ),         ) );     }     add_action( 'init', 'custom_post_status' );      Thanks for help with this.


Compact pingback list with favicons

On a blog with pingbacks and trackbacks (pings) enabled I want to show just a link with link text and a favicon of the external site in a compact list: no date, no text. How can I do that?


Move WordPress from /blog folder to root but leave post at /blog

I am working on a WordPress blog for a client. Currently they have around 3,000 posts. The WordPress is installed at `/blog/` I need to move the WordPress install to the Root directory but still have the Blog posts show up at `/blog/` so after I move the blog, all the Post URLs will remain the same. I have to do this regardless of how I do it this has to be the outcome. I'm hoping for an easier method though. Any ideas?


Checkbox won't check when label is clicked

I'm not sure if this is a WordPress specific issue but when I create a simple form as a widget in my sidebar the checkbox won't check when I click on the label. Strangely though, it does work when I've pulled the same form via get_template_part into my navigation. I want to use the 'checkbox hack' which relies upon the label being clickable. My form looks like:               <form action="http://email.littlefishfx.com/t/r/s/jijiat/" method="post">
             <input id="fieldjtdktry-0" name="cm-fo-jtdktry" value="4469820" type="checkbox" /> Learn             <input id="fieldjtdktry-1" name="cm-fo-jtdktry" value="4469821" type="checkbox" /> Trade             <input id="fieldjtdktry-2" name="cm-fo-jtdktry" value="4469822" type="checkbox" /> Invest             <input id="fieldjtdktry-3" name="cm-fo-jtdktry" value="4469823" type="checkbox" /> Spend

             <input id="fieldEmail" name="cm-jijiat-jijiat" type="email" required placeholder="Your email address" />
             <button type="submit">Subscribe</button>
     </form>      Both forms can be found at littlefishfx.com/contact, one dropping down out of the main menu 'subscribe' button and another (same form) at the very bottom of the sidebar. Any advice on why this might be happening? Same results in Chrome, Safari and Firefox (mac). ** EDIT ** If I wrap my check boxes in the label like               <input id="fieldjtdktry-0" name="cm-fo-jtdktry" value="4469820" type="checkbox" />Learn      Then label clicking works across the board. This looks a best practice solution (?) but leaves me stumped as to how to use the check box hack I was originally trying to implement. Here's the CSS that I've been working on:               input[type="checkbox"] {         display:none;     }     input[type="checkbox"] + label span {         display: inline-block;         width: 20px;         height: 20px;         margin: -1px 6px 0 0;         vertical-align: middle;         background: url(images/checkbox-sprite.gif) left top no-repeat;         cursor: pointer;     }     input[type="checkbox"]:checked + label span {         background: url(images/checkbox-sprite.gif) right top no-repeat;     }


Getting taxonomies specific to categories

I have categories set up for car manufacturers. I have 4 custom taxonomies that are also set up: color, starburst, offer_type, and logo_count. Each post I upload to my wordpress has values for all 4 of those taxonomies and is assigned a category. I have a custom page template setup to display all posts that have the same category as the current page's slug. query_posts:               <?php query_posts('category_name='.get_the_title().'&post_status=publish,future&posts_per_page=-1');?>      My end goal is to display the taxonomies in the sidebar and allow users to visit a manufacturer's page, and filter the content they want to see based on their selections in the sidebar. I know how to display the taxonomies in the sidebar, I'm just not sure how I would have the content filtered.


jQuery Plugin to use Wordpress functions in AJAX request

I'm using Chained Selects jQuery Plugin to create **multiple chained selection fields**. I'm using the _remote version_ of the plugin to build the related options by means of **AJAX request** from a **separate PHP file**. So basically it works by calling the following code:               $("#field2").remoteChained("#field1", "/data/json.php");      ## What I would like to do I would like to **use Wordpress' functions** in the **PHP file** (in this case: **/data/json.php** ) to create the options **dynamically**. But I **do not** want to use `mysql_query()` to search through the database. I understand that in Wordpress you have to use **admin-ajax.php**. But I'm not sure how to **integrate it with the plugin above**. ## Sample Case **For this example, let's just use Wordpress' category**. So the two select fields will be the category field and the sub-category field. The latter one will relate to the former one, ie. the parent category. > Note: In my actual project, I'm using PODs CMS plugin to create a list of > items from a **content type** _(which is like custom post type)_ that is > related to another list of items in another **content type**. These will > become the options in my chained select fields. ## What I have tried so far   1. The HTML:              <?php     wp_dropdown_categories('show_count=0&selected=-1&hierarchical=1&depth=1&hide_empty=0&exclude=1&show_option_none=Main Categories&name=field1');     ?>     <select name="field2" id="field2"></select>        2. Call the scripts (in `functions.php`):              function the_scripts() {         // The Chained Selects jQuery Plugin         wp_enqueue_script('chained_select', get_template_directory_uri() . '/js/jquery.chained.remote.js', array('jquery'), false, true);              // The script to call the action         wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery','chained_select'), false, true);              // code to declare the URL to the file handling the AJAX request         wp_localize_script( 'scripts', 'the_ajax_script', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );     }          add_action('wp_enqueue_scripts', 'the_scripts', 100);        3. The code to call the action (in `scripts.js`):              $(document).ready(function (){              jQuery.post(             the_ajax_script.ajaxurl,                 {                     action : 'myajax-submit'                 }                 ,function( response ) {                     $("#field2").remoteChained("#field1", the_ajax_script.ajaxurl);                 }         );          });        4. The action (in `functions.php`):              function get_options() {              $response[""] = "--";              if ($_GET["field1"]) {                  $categories =  get_categories('child_of='.$_GET['field1'].'&hide_empty=0');                  $response[""] = "--";             foreach ($categories as $cat) {                 $response[$cat->term_id] = $cat->cat_name;             }              };              print json_encode($response);              exit;     }          add_action( 'wp_ajax_myajax-submit', 'get_options' );     add_action( 'wp_ajax_nopriv_myajax-submit', 'get_options' );      This whole thing doesn't work in that the jQuery plugin isn't doing it's job. How can I communicate Wordpress with this plugin? Thanks in advanced.


Why Won't Exported Blog From One Site Import Into New Site?

I have an old RHEL Workstation site, running the latest wordpress version 3.5.1. I have a newer CentOS 6.4 site, running the latest wordpess version 3.5.1. I have added the Wordpress import plugin tool into the new site successfully. I have exported the entire blog from the older wordpress site successfully. I have attempted to import the resulting xml file, but it appears not to succeed, but without any errors or explanation. The import appears to start successfully after pressing the button for uploading and importing, after the .xml file is selected, and I see some activity. However, the Import page goes blank, and there are no errors or any other kind of message. The blog is still usable; that is nothing has frozen. What do I need to do to import properly?


When I have something on a specifc custom field, how can I show it of the place of featured image?

I want in the place of the featured image of a post -depending on the subject of the post- , to show shortcodes (example shortcode to put on custom field:[ngg_images gallery_ids="1" display_type="photocrati- nextgen_basic_slideshow"]), emebed tweets (example link to put on custom field: https://twitter.com/nikestore/status/471416532317532160). emebed instagram photos (example link to put on custom field: http://instagram.com/p/oJjacIgUXk/) or anything else. If I haven't put anything in this custom field it would show the full sized featured image. I made this code but it showed me the featured image and what I added on the custom field. Then I tried what it was saying on that reply which doeas what I want but it works only with the shortcodes and with some conflicts. It doesn't support tweets, nor instagram photos or anything else. Which is the right way to make it work?


Programmatically Split A Post Into Multiple Pages

We all know that when you're creating a standard post in WordPress you can split the post into multiple pages by adding this code into the text body:               <!--nextpage-->      Is it possible to split a post up like this programatically? I have a gallery custom post type which only displays attached images, so it's not possible to add the above comment anywhere. I would like the gallery to display _n_ images at a time and then show pagination links. (I'll in fact be using an infinite scroll script but that's irrelevant).


Add tag to post api wordpress

I have been googling around but could not find the "add tag to post" api/codex. Does anyone know what it is ? Also, the "delete tag from post". Thanks.


How to sort by post_date and meta_value_num?

On a page, I want to display content from four areas, posts and three custom post types, and sort them all by date. The post date is post_date and the cpt dates are meta_value values called, for example, cpt_date1, cpt_date2, and cpt_date3 (containing strings in unix date format). How do I write arguments for WP_Query to accomplish this? Any help is appreciated!


How to make a metabox that contains link categories?

I'm looking for some suggestions or tutorial links about how to create a meta box that allows users to choose from a list of link categories. So far I've been looking at this post about taxonomies in a drop down and this post about an audio file drop down. I've also looked at get_terms. The end goal is to display the links within the user selected link category on a single post page. Update #2. Have this working properly now (updated code). Last thing: I just need too find a way to keep the selected option selected. It saves the right value, but visually just defaults to the first option. Using this post as guidance.               function tf_book_purchase (){         global $post;                 $custom  = get_post_custom($post->ID);                 $link    = $custom["link"][0];                 $selected = isset( $custom['link'] ) ? esc_attr( $custom['link'][0] ) :'';                           echo '
';                           $myterms = get_terms("link_category");                      echo '<select name="link" id="link">';                 echo '<option class="buy_books">Select A Link Category</option>';                 foreach($myterms as $term){                             $term_slug=$term->slug;                             $term_name =$term->name;                             $term_id =$term->term_id;                          ?>   <option value="<?php echo $term_id;?>" <?php selected( $selected, ".$term_id." ); ?>><?php echo $term_name;?></option>                      <?php   }                            echo '</select>

';                  echo '
Please select a set of purchase links for this book.
';               }                        add_action ('save_post', 'save_tf_book_purchase');              function save_tf_book_purchase() {              global $post;              // make sure we're on a supported post type             if ( $_POST['post_type'] != 'books' ) return;                    // verify this came from our screen and with proper authorization.             if ( !wp_verify_nonce( $_POST['book_nonce_name'], 'book-nonce' )) return;                  // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything             if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;                       // Check permissions             if ( 'page' == $_POST['post_type'] ) {                 if ( !current_user_can( 'edit_page', $post_id ) ) return;             } else {                 if ( !current_user_can( 'edit_post', $post_id ) ) return;             }              //if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){ return $post->ID; }              update_post_meta( $post->ID, 'link', esc_attr( $_POST['link'] ));              }


Styles are not loading when changing permalink to %postname%?

Fist I was using default option of permalink and everything was fine (speed is ok, my own created theme is working fine) but now I change default structure to post name structure of permalink now I am not getting 404 error but the problems are : 1 - Whole website is loading very slow (pages,post) . 2 - My custom theme is not working fine means styles are not working on single page or single post. I checked my .htaccess file where the code is :               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /wordpress_1/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wordpress_1/index.php [L]     </IfModule>          # END WordPress


Alternative to query->set that appends conditions instead of overriding

I am applying a taxonomy condition to the main query in my plugin which is excludes an array of post formats from it. It's being done as follows:               $query->set('tax_query', array(         array(             'taxonomy'  => 'post_format',   // Post formats are queried as taxonomies             'field'     => 'slug',             'terms'     => self::$formats,             'operator'  => 'NOT IN'         )     ));      This is working - the post formats are being excluded as I wanted them to. However the problem is that if any `tax_query` condition was specified before, then it would be overridden and lost in space and time. Is there any way I can append my `tax_query` condition without losing overriding all conditions before it?


How to manually activate user in dashboard only by admin

I'm looking for a function that allows admins (only) to activate new users. When a user registers he have to be approved by the admin before he gets access to log in. Does anyone know how I can do this?


How can I create a Quora or Stack Exchange facility without using a specialist theme?

I would like to implement a section of my site that can be used for Q&A, like Quora or the SE sites. So far, the only solution I can find is to use a specialist theme, which I don't want to do - I want the feature to be part of an existing site. What methods or solutions can I use that might work for me in this instance?


Download WordPress.com theme: how?

I like this theme. But I don't want it to use with a wordpress.com blog but download it to use with my WordPress site at my own domain. But I can't find a download link. Is it possible?


How do I add settings to the Background Options Page?

I am developing a theme and I wanted to add some extra content to the built in background options page. I know how to use the settings API to create new theme options and settings but I can't seem to figure out where it's actually calling to the background page. I have searched through `wp- includes/theme.php` and still not much there except to calls to the background functions and nothing that actually renders the page. Could this not be done with an action?


Defining different theme for Blog posts page

So, I'm using my wordpress with a static front page and then I have Blog link that opens the blog posts. My question is, how can I apply a different template/styling only to that area?


array_pop() expects array, boolean given for $event_type_term ->slug

I have the following function I wrote …               add_filter('post_type_link', 'events_permalink_structure', 10, 4);          function events_permalink_structure($post_link, $post, $leavename, $sample) {         if ( false !== strpos( $post_link, '%event_type%' ) ) {             $event_type_term = get_the_terms( $post->ID, 'event_type' );             $post_link = str_replace( '%event_type%', array_pop( $event_type_term )->slug, $post_link );         }         return $post_link;     }      When creating a new post I get the following Warnings in the backend … > Warning: array_pop() expects parameter 1 to be array, boolean given in > /Users/my/htdocs/wr/wp-content/themes/wr/functions.php on line 168 > > Notice: Trying to get property of non-object in /Users/my/htdocs/wr/wp- > content/themes/wr/functions.php on line 168 Any ideas what I'm doing wrong here? Thank you in advance!


Sanitize Disqus API results?

Can I trust the results from the Disqus API, not to include evil scripts? Can I find information somewhere. Would you sanitize the JSON data, that is returned? Official answers?


Binding Serialized Setting to JS for Realtime Response

I'm stuck in a situation. I'm developing a theme where I'm using the wordpress theme-customizer to build the settings page. I'm using the serialized method, something like this:               $wp_customize->add_setting( 'my_theme_options[link-textcolor]',              array(                 'default' => '#2BA6CB',                 'type' => 'option',                  'capability' => 'edit_theme_options',                 'transport' => 'postMessage',              )            );      And then I'm adding a function to add the JS once customizer loads:               function my_theme_js()     {         wp_enqueue_script(                'my-theme-js',                           get_template_directory_uri().'/js/customizer.js',               array( 'jquery','customize-preview' ),               '1.0',                                       true         );     }          add_action( 'customize_preview_init', 'my_theme_js' );      Now, in JS file, I'm doing something like this:               ( function( $ ) {         wp.customize( 'my_theme_options[link-textcolor]', function( value ) {             value.bind( function( to ) {                 console.log('executed the method');             } );         } );     } )( jQuery );      Now, the issue here is: It works when I don't use serialized method but, once I use the serialized method, it stops working. What is it that I'm missing here?


Save user login date

I want to save the last login date but it doesn't work properly. It saved the first time I logged but then when I logout and loggin it doesn't change the last login time. (Stay the same)               add_action ( 'wp_login', 'set_last_login' );          function set_last_login ( $login ) {         $user = get_userdatabylogin ( $login );              // Setting the last login of the user         update_usermeta ( $user->ID, 'last_login', date ( 'Y-m-d H:i:s' ) );     }


insert link in wordpress editor greyout whole screen?

Pulling my hair with this strange issue. When I want to insert link in wordpress page or post, my whole page screen is greyed out, and insert link feature dont work. I tried to disable plugins, insert fresh files for tinymce, install several others editors... But, nothing. Issue is same on both, visual and html editor. Please help and thank you.


esc_html__ security : what for in this example?

how does `esc_html__` (the 2nd one) protect the `$message` variable from being hacked ? what's the point to use this protection here (the second one with a plain text)?               <?php          function unknown(){              /* If the user input any text, escape it. */         if ( !empty ( $_POST['unknown'] ) )             $message = esc_html ( $_POST['unknown'] );              /* If no text was input, use a default, translated message. */         else              $message = esc_html__( 'No message input by the user.', 'unknown' );              return $message;     }          ?>      Thanks


Plugin generated taxonomies' permalinks with custom placeholders

I have a problem with permalinks for custom taxonomies generated with Types http://wordpress.org/extend/plugins/types/, a plugin for creating taxonomies, custom posts and custom fields. The problem is that once i set up my taxonomy i'm not able to configure the permalinks. The options for my taxonomies are:   Plural name: Volumes   Singular name: Volume   Slug: volume   Rewrite: yes In the permalinks i choose custom and set: `/%volume%/%postname%/` But then the posts url, instead of showing the actual taxonomy slug, it shows the permalink code, link eg this: `http://www.zonasismica.sism.org/%issues%/editoriale/` The post name is replaced, but the taxonomy not. Of course the link doesn't work... I really cannot understand what is going wrong here.


Non existing blog pages are not redirected to 404

I've got a page called Blog. In the `Settings -> Reading` I've set my `Blog page` as `Posts page`. In the menu when I click on the `Blog` link the posts are loaded correctly and pagination works, so far so good. All the info is coming from the `home.php` template. I'm using my own pagination code that generates the pages looking at `max_num_pages and paged` params. In short it generates correct amount of pages with the correct links. However, when I test a non-existent blog page. For example there are 5 pages exist and I type `blog/page/6` it doesn't get redirected to 404, instead it seems to fall back to the else statement of the main `if(have_posts())`. I've tested the category paginated pages that use the same pagination code, they work correctly: non existing category pages of type `category/<category_name>/page/2` are redirected to `404` template. I can't think of anything why the main blog 'paged pages' that don't exist won't redirect to 404. I would hugely appreciate any tips and help. Many thanks, Dasha


Custom post type - filter content by custom meta box content

I have custom post type with some products. I need to add some content filtering now. I have custom meta box with "author". I want to add buttons with authors that will act like categories. So let me explain it by example: I have 3 products: (product num - author)               1 - John     2 - Sarah     3 - Tom      When I go to my page I see all three products. I want to add 3 buttons on top: `John| Sarah | Tom` Every click on button filters results of my query. So by clicking John we see only one product on my site - product 1. How to bite this? I've displayed text with authors using another query_posts() above my original query, but I have no idea what to do next?


Lightbox on wordpress post page

I am building WordPress admin plugin. In which I have a metabox with 10 checkboxes (It can be more than that). At below there is submit button. My requirement is: (A) open a lightbox when some one clicks on submit button. (B) In this lightbox I want to show all selected checkbox values with checkboxes. (C) Again, On this lightbox there would be a submit button. On clicking this form needs to be submitted with selected checkboxes values. The lightbox will work as confirmation window, Any help much appriciated.![enter image description here](http://i.stack.imgur.com/ONPuF.png)


How to show a under construction page for a domain but still be able to work on index.php?

I installed a WordPress for a domain name. When I use this domain name will point to `index.php` in my template. I want show a under construction page for this domain name, but the other hand I still want work on `index.php` in my template.


Get Product id from order id in Woocommerce

I am having trouble with Woocommerce product details and order details relationship. I'm not able to find the product ID of a related order ID on the _View Orders_ page of the Woocommerce theme. I simply want to get the product content and permalink etc on _View Orders_ page. I tried searching in `wp_postmeta` but had no luck.


How to get the post's parent ID?

I have a template which outputs the blog posts (Blog Page), I open one of the posts which use single.php template, Now how can I get the ID of it's parent which is the (Blog Page)? I should say that I want to use this ID to get the meta box value of the blog page in single.php. The same goes for a custom post type, let's say 'project', Where a page template list the project's posts (Projects Page) and single-project.php for the single project post. in this case I want to get the (Projects Page) ID in single-project.php.


PHP Fatal error: Out of memory / Unknown Error On Line 0

I know this has been posted a number of times but I'm getting really stuck so thought I would see if anyone can help. My error logs keep getting these errors               [24-Apr-2013 01:25:44] PHP Fatal error:  Out of memory (allocated 17039360) (tried to allocate 7680 bytes) in /home/sywpcouk/public_html/hitthefloor/wp-includes/post-template.php on line 1161     [24-Apr-2013 06:00:42] PHP Fatal error:  Exception thrown without a stack frame in Unknown on line 0      As with most people the file is always different so nothing set and I have no clue about the stackframe one but guessing they are related as I normally get a load of our of memory followed by the Unknown On Line 0 error. My host has actually set the memory limit to 500MB which is really high so there should be no way on earth im going out of memory. This can be seen when I check the phpinfo Tried these fixes   1. Added `define(‘WP_MEMORY_LIMIT’, ’500M’);` to wpconfig   2. Installed Change Memory Limit Plugin and set to 500M   3. Set memory in `php.ini` (Host did this and set to 500M)   4. Checked plugins by turning them on and off   5. Optimized/Repaired Database I installed the Memory Overview Plugin and it was saying               PHP Version : 5.2.17 / 64Bit OS Memory limit : 500 MByte Memory usage : 53.17 MByte      So seems like I shouldn't be getting this error. I'm on a VPS with 4GB memory Plugins installed   1. Adrotate   2. BUlletproof Security   3. Change Memory Limit   4. Custom Permainks   5. Disqus   6. Members   7. Nextgen Gallery   8. Nextgen Gallery Optimizer   9. Social Networks Auto Poster   10. Really simple facebook twitter share buttons   11. Redirection   12. SEO Friendly Images   13. Sidebar & Widget Manager   14. Sticklr WP   15. w3total cache   16. Wordpress SEO   17. WP-DB Manager   18. WP-Memory Usage   19. WP-Page Navi   20. WP Category Post List Widget   21. YARPP   22. WP Missed Schedule Whatever the problem is it slows down my site so much. If it gets too bad I do a graceful server reboot and works lighting speed again. Any ideas? I'm a bit of a newbie when it comes to a lot of this technical stuff so please bear with me. I also have no idea how to use shell but I'm more than willing to figure it out if need be. This problem is affecting my business so really need to get it sorted asap as been ongoing for way to long. UPDATE Also tried this fix with changing Apache memory limit http://www.netmagellan.com/php-fatal-error-out-of-memory- allocated-28311552-1526.html PHP Memory is also now set 256M and not 500M. Still getting the errors               [26-Apr-2013 12:51:26] PHP Fatal error:  Out of memory (allocated 34078720) (tried to allocate 491520 bytes) in /home/sywpcouk/public_html/hitthefloor/wp-content/plugins/relevanssi/lib/search.php on line 457     [26-Apr-2013 12:51:30] PHP Fatal error:  Out of memory (allocated 24379392) (tried to allocate 122880 bytes) in /home/sywpcouk/public_html/hitthefloor/wp-includes/vars.php on line 87     [26-Apr-2013 12:51:30] PHP Fatal error:  Out of memory (allocated 18087936) (tried to allocate 30720 bytes) in /home/sywpcouk/public_html/hitthefloor/wp-includes/comment.php on line 1952      Also noticed these erors have appeared in the log as well               [26-Apr-2013 07:07:29] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/timezonedb.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/timezonedb.so: failed to map segment from shared object: Cannot allocate memory in Unknown on line 0     [26-Apr-2013 07:07:29] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo.so: failed to map segment from shared object: Cannot allocate memory in Unknown on line 0     [26-Apr-2013 07:07:29] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_sqlite.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_sqlite.so: failed to map segment from shared object: Cannot allocate memory in Unknown on line 0     [26-Apr-2013 07:07:29] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite.so: failed to map segment from shared object: Cannot allocate memory in Unknown on line 0     [26-Apr-2013 07:07:29] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so: failed to map segment from shared object: Cannot allocate memory in Unknown on line 0      Any ideas?


Moving Posts to a new site and maintaining URLs

I am looking to move all my posts to a new site. The new site is sitting in a dev environment and will eventually be launched in place of the new site at the same URL. The blog posts will not have the same structure however. The old site URL structure is `www.example.com/blog` and the new site will not have the `/blog`. It will just be `www.example.com/my-post-example` I have tried using the export/import tool but I am having trouble with the URLs after. After importing the URLs have the default WordPress URL with numbers and question marks and when I manually change the permalink they have this at the end `www.example.com/my-post-example#.UpMsHo1hA6I`. Does anyone know the how I should be going about this so that I minimize the SEO impact of all the posts created?


Navigation won’t update to show full path to single post

I have a site with a custom post type “projects” and two taxonomies “clients” and “mediums”. For the navigation I’m using a custom nav walker (that extends Walker_Nav_Menu). This all works very well and allows URLs such as: /mediums/print/ (showing selection of print projects) /clients/clientA (showing selection of projects for clientA) I have page templates for clients and mediums and templates taxonomy- clients.php and taxonomy-mediums.php. Ideally I would like to be able to have both those URLs and the nav continue to select an individual project through either client or medium e.g. /mediums/print/project-A /clients/clientA/project-A But after a very long search and searching way too many forums it seems this isn’t possible with Wordpress. Therefore I had to go with one path and chose: /mediums/print/project-A To allow this to work and not just display all single projects post under /projects/project-A I’m adding a filter hook to 'post_type_link' which modifies links to follow the full structure of /mediums/print/project-A and in the custom post type I’m using a placeholder %mediums% which is replaced by the relevant taxonomy term. Again, this all works very well and now allows browsing by client or medium and selecting the project which then selects the full URL. The problem I’m having is now the navigation doesn’t show any state for the single-projects.php template (nav is global and in the sidebar). I can see that this is most likely because although I’ve managed to get the URL and the links to work showing the full path WP and hence the walker don’t see the custom post type project as sitting below mediums/mediums-term and so doesn’t create the nav items required to show this state. Does anyone know how I can get the walker to “see” this relationship? I don’t think it’s unreasonable for users to want to selectively drill down to a project in this manner through project taxonomy and land on the project at the end of the tree rather than just jumping out to /projects/project-A with no reflection of the state in the navigation. Thanks.


Admin user roles/permissions

I have a user who I would like to able to publish new posts/pages, but I don't want them to have access to users. I may want to let them have access to specific plugins, but not others. Is there a plugin for this? A built-in method I'm not seeing? I'm a little lost on how to go about managing permissions.


Search redirect to the same page

I know this question has been asked billion and billion times on the web, but all the solutions don't work for me : My search form redirects to the same page, just adding searching parameters at the end of my url. So if I'm on the Home page it works, redirecting to the search page. But if I'm on a static page, dœsn't work, Page not found. In my template, I call the engine :               <?php get_search_form(); ?>      Then I have a search file : looks like a category page. And a file searchform.php :               <form method="get" id="searchform" action="<?php echo esc_url(home_url('/')); ?>">     <div><input type="text" name="s" id="s" />     <input type="image" src="<?php bloginfo('template_url'); ?>/images/btn.png" />     </div>     </form>      Here, in action, I tryed EVERYTHING ! Lots of post about that on the web, but I always have the same results.. Do I need maybe to insert a hidden field ? Thanks in advance for your help !


Get Specific Template Part if Custom Field is Some Value

I have a problem and I don't know how to solve it. I tried some solutions but I failed since I am not good programer. I also tried to find a solution, but there is no similar question asked. So... here is the problem. I have a custom post type called "Arrangements", and one of the custom fields associated with that CPT is select box called "Nights" ( **rtm_nights** ), with options:   * no nights   * 1 night   * 2 nights   * 3 nights In my **single-arrangements.php** there is a **get_template_part** function that call **content-arrangements.php** , and now I made 4 similar files, because I need to reorganize arrangements template:   * content-oneday.php   * content-twoday.php   * content-threeday.php   * content-fourday.php Now... what do I need is to get some of these content templates depending of what is chosen in rmt_nights field.   * If "no nights" is chosen **content-oneday.php** should be called via get_tempalte_part.   * If "1 night" is chosen **content-twoday.php** should be called via get_tempalte_part.   * If "2 nights" is chosen **content-threeday.php** should be called via get_tempalte_part.   * If "3 nights" is chosen **content-fourday.php** should be called via get_tempalte_part. I tried something like this in different versions but it is obviously a wrong approach:               <?php if ( get_post_meta($post->ID, 'rtm_nights', '3 nights') ) ; ?>     <?php get_template_part( 'content', 'fourday' ); ?>     <?php if ( get_post_meta($post->ID, 'rtm_nights', '2 nights') ) ; ?>     <?php get_template_part( 'content', 'threeday' );  ?>     <?php if ( get_post_meta($post->ID, 'rtm_nights', '1 night') ) ; ?>     <?php get_template_part( 'content', 'twoday' );  ?>     <?php if ( get_post_meta($post->ID, 'rtm_nights', 'no nights') ) ; ?>     <?php get_template_part( 'content', 'oneday' );  ?>     <?php endif; ?>


Character \ appearing before ' after saving a settings page

It's a strange issue and I've seen it happen with plugins, however I don't know how to fix it. Maybe just a PHP issue? Anyhow, I have a settings/options page with several text areas. Upon saving, a "\" appears before each apostrophe. Each time it's saved, an additional back- slash appears. I'm not sure what code would be helpful to look at for this.


Adding Custom Post Type to Woocommerce

Can you please let me know if there is any way to add your own Custom Post Type to Woocommerce and use that instead of using Woocommerce Product? Thank


creating single page with 2 columns while theme is 3 column

I am using Diapason theme , which gives me an option for both 2 column or 3 columns...My requirement is 1:- all pages except home page (static) should have 3 columns 2:- Home Page should have two columns ( one left sidebar, and the other is main contents) 3: Header Footer and left side bar is common amongs home and other pages.. How can I do that..I know either I can use 2 columner or 3 columner, but not both at the same time.. please guide me with step by step procedure ( not the code, rather algo) thanks to everyone trying to help me..


Approve post directly from preview mode?

How do I approve a post directly from preview mode, instead of having to return to edit mode and/or "list of posts" mode? I'm script-matically uploading several (hundred) posts, but want to live preview them briefly before approval.


Why does this snippet in a blog post make WordPress crash?

Ok, this is seriously weird and I have no clue what's going on here. I am using WordPress 3.0.1, I create a new blog post, give it a title, paste the following code into the blog post and hits Save Draft.               <code lang="php">     // Init curl     $request = curl_init();          // Set request options     curl_setopt_array($request, array     (         CURLOPT_URL => 'https://www.sandbox.paypal.com/cgi-bin/webscr',         CURLOPT_POST => TRUE,         CURLOPT_POSTFIELDS => http_build_query(array             (                 'cmd' => '_notify-synch',                 'tx' => $_GET['tx'],                 'at' => $your_pdt_identity_token,             )),         CURLOPT_RETURNTRANSFER => TRUE,         CURLOPT_HEADER => FALSE,         CURLOPT_SSL_VERIFYPEER => TRUE,         CURLOPT_CAINFO => 'cacert.pem',     ));          // Execute and get the response and status code     $response = curl_exec($request);     $status   = curl_getinfo($request, CURLINFO_HTTP_CODE);          // Close     curl_close($request);     </code>      Just a code example in my head, but seems like WordPress thinks otherwise, cause when I hit Save Draft, Preview or Publish all I get is a blank page with the following text: > Service Temporarily Unavailable > > The server is temporarily unable to service your request due to maintenance > downtime or capacity problems. Please try again later. What in the world is going on here??


WordPress automatically "forward" a post to another blog?

I have a personally hosted WordPress installation. When I write a new post I want an excerpt of the post and a link to it to be posted to a different blog (via the Blogger or MetaWeblog APIs). I've seen it done before, though I don't know if WordPress was the platform of the original blog post. Is there a plugin to do this, or a setting I don't see perhaps?


Slideshow control for use in Wordpress Thesis theme - non flash

I want to use a good elegant slideshow control in my website. The website is created in wordpress and I am using the Thesis theme. I did find a Nivo slider but am stuck at the integration with Thesis (using the custom functions and custom css files). Can someone suggest a good non-flash slideshow widget which I can easily integrate with the theme (and also how to integrate it) Thanks.


WordPress Page Reload Takes forever during theme development

OK, I'm hacking my way through my first theme (while reading Prof. WP Design & Development 2nd Ed.) and .... EVERY TIME I change -for example- a p tag or a div tag or a css rule, when I then go to reload the page to see changes ... I....wait....and....wait.... for the dang page to reload!?! I'm seeing "cache issue", but I'm unsure of exactly what that means, so I'm not sure that IS my problem. IF this is a cache issue, can someone please explain exactly _what is going on under the hood_ during the reload? And just what I can do about it? Can someone break this down a bit for the noobs. :) thanks, sleeper


Moving WordPress Site from MAMP to cPanel - How?

I am looking at moving my WordPress site from localhost on my mac (MAMP – htdocs directory) to online hosting that is using cPanel. When I log into my cPanel online, I am presented with my home directory that includes the following directories:               1)  public_html     2)  www      My question is, what is the equivalent “htdocs” directory in MAMP on my localhost within cPanel online - is it public_html directory or www directory? Like to know where I install WordPress within cPanel as well as child theme that I currently have on my mac(localhost)? If there are any decent sites that take you through this scenario, would really appreciate any links. Thanks.


why does blog page ignore template

This is never answered completely anywhere. If there is a dropdown to select what page I want to use for my blog, why would it ignore the template I select? I realize it uses the index. Then why in the world would they a) make you name a page if they ignore it anyway. b)give you an option to chose a template if they ignore it. I read all of the 'it doesn't work that way' posts all over...why the options? If it ignores it why would I select a page to use? Why would it ignore my template? So I customize the index page. Then there is zero reason for the option. I can pick a front page template but for the blog, they give the options and then just ignore it. Makes no sense. But I can edit the index. Sounds totally stupid.


Theme settings default, strange behavior before first save

I was building a theme options page with the settings API. I use an ajax call to compute some settings automatically from other pages / tabs. I noticed that all of the new settings default ("std") will display in their input fields but will be undefined when I make the ajax call using :               array_merge(get_option('some_options', 'fail'), get_option('some_other_options', 'fail'));      That is they will be undefined until the first time I save the new settings. All of the previously defined settings will be rendered in the resulting object, but all of the newly authored additions will be undefined. I was wondering if the option's defaults are saved when you switch to the theme for the first time. So when I add new options while using that theme the options defaults are not being saved. I am concerned, if that is the case, that some key values would be omitted when a user first activates this theme. So just to be clear on what is happening. 1) I have some options to start with. -> everything is good. 2) I author some new options. -> trouble starts 3) Settings page loads. Default values are in the input fields but, when I make the call and check the database. "undefined" is returned for those new settings. All the other settings are fine. 4) Reload page. -> no change 5) Save changes. 6) Ajax call is fine, all values defined.


Removing the custom_image_header from wp_head

I am looking to remove the custom_image_header from the wp_head. I would like to use this in a more manual way throughout my theme. I understand the general approach for this is to include CSS in the head but I would like to keep all of the CSS for the theme outside of the head. Any ideas? Thank in advance, JN


'Remote Login' with MultiSite Domain Mapping still forcing users to login to all blogs individually?

I'm having trouble with the 'Remote Login' option of MultiSite domain mapping. I have a local dev install which allows me to swap between network blogs _without_ needing to login to each blog individually (which is my understanding of what Remote Login allows?). But the live version of the Network forces all users to login to each network blog individually (which is frustrating). I have picked Otto's brain about it --as he mentioned some time ago that the Remote Login feature was "iffy at best"-- and he suggest he's not had any later success without custom scripting. @pwcc has had success with it though not whilst using Theme My Login plugin (which I'm using). Any suggestions anyone?   * I have tested in multiple browser, and cleared cookies   * I do not have any cache plugins installed


Custom Post Types 404 Issue

I dont know why my custom post types render the Page not found. This is the code I am using to register custom posts. `www.example.com/products/product1/` renders 404 where as `www.example.com/?products=product1` is perfectly fine.               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type('products', array(             'label' => __('Products'),             'singular_label' => __('Product'),             'public' => true,             'show_ui' => true, // UI in admin panel             '_builtin' => false, // It's a custom post type, not built in!             '_edit_link' => 'post.php?post=%d',             'capability_type' => 'post',             'hierarchical' => false,             'rewrite' => array("slug" => "products"), // Permalinks format             'supports' => array('title','author')         ));     }


get post author id outside loop

I need to place in post edit dashboard metabox with post author e-mail (or other user meta fields). So it can be edited when admin reviews this post.               $meta_id = get_the_author_meta( 'user_email', $user_id );          $meta_box = array(         'id' => 'my-meta-box',         'title' => 'DANE FIRMY',         'page' => 'post',         'context' => 'normal',         'priority' => 'high',         'fields' => array(             array(                 'name' => 'E-mail box',                 'id' => 'mail',                 'type' => 'text',                 'std' => $meta_id             )         )     );      This code works when $user_id is an integer (when I manually put there for example 4) but i want to dynamically get current author id ( `$user_id` ). `get_the_author_meta('user_mail')` should work without specifying `$user_id` (codex says that :)) but code is in `functions.php` and outside the loop so it doesn't work. I'm starting with Wordpress and PHP so I don't know what to do next. Also tried this:               global $post;     $user_id=$post->post_author;


how can I go about creating a dashboard in the post section of wordpress admin

I am trying to create a dashboard in post section of wordpress admin area. I want it just underneath the Publish dashboard. like for example this code here place a dashboard in immediately when I log into the admin area.               // Create the function to output the contents of our Dashboard Widget          function example_dashboard_widget_function() {         // Display whatever it is you want to show         echo "Hello World, I'm a great Dashboard Widget";     }           // Create the function use in the action hook          function example_add_dashboard_widgets() {         wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');        }           // Hook into the 'wp_dashboard_setup' action to register our other functions          add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );


How to get the post terms from a child taxonomy

I have the following code that gets the slug of the taxonomy "author" from a custom post type "books" and gets the post from another custom post type "authors" that has the same slug.               <?php          global $post;     $bookauthor = wp_get_post_terms( $post->ID, 'author' );     $slug = array_shift( $bookauthor );     $custom_query = new WP_Query( array( 'post_type' => 'authors','name' => $slug->slug ) );          if($custom_query->have_posts()) :      while($custom_query->have_posts()) :      $custom_query->the_post();          ?>      Now I need to get the slug of a child taxonomy of "author" called "new-author" but don't know how to modify the code. Suggestions welcome!


using pre_get_posts for search results not found

function hotlinkers_wp_query($query) {               if ( !$query->is_admin && $query->is_search) {                 $search_query = str_replace('-',' ', $query->query_vars['s']);                 $query->set('s', $search_query);          }               return $query;     }     add_action('pre_get_posts', 'hotlinkers_wp_query');      this is for the search results found, on search.php i have an else, so if no searches are found it shows 15 random posts (using wp query) wanted to avoid that if possible to do via pre_get_posts.


Use post object from first query in second query

I have a post ID stored in a variable from my first query and I'd like to use that to highlight the post with the same ID in my second query, but it's not working. First loop:                       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                      <?php foreach(get_field('relationship') as $post_object): ?>                 <?php $current = get_the_ID($post_object->ID); ?>                 <?php echo $current; ?>                     <a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID) ?>                 <?php endforeach; ?>                      <?php the_content();?>                  <?php endwhile; else: ?>              <?php endif; ?>      The post is queried in my second loop,(not related to the first), only I don't know how to identify it by the variable from the first loop. Second:                               <?php $news_arg=array(                         'post_type' => array ('books'),                         'post_status' => array( 'publish'),                         'posts_per_page' => 20,                         );                         $arg_query = new WP_Query();                         $arg_query->query( $arg );                     ?>                     <?php if( $arg_query->have_posts() ) : ?>                     <?php while( $arg_query->have_posts() ) : $arg_query->the_post(); ?>                     <?php print_r($arg_query) ?>
                 <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
                     <?php endwhile; ?>                     <?php else : ?>                     <?php endif; ?>       Thanks. EDIT: Alex's answer with Chip's correction should work but for some strange reason it doesn't, so I post my full code in case anyone spot the problem. (There are no other queries or any other php on the page): EDIT: `replaced get_the_ID` with `get_permalink` and now it works:
         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

         <a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID) ?>

          <?php foreach(get_field('relation') as $post_object): ?>     <?php $current = get_permalink($post_object->ID); ?>     <?php endforeach; ?>
     <?php echo $current ?>     <?php if(get_field('lead')) {         echo '
' . get_field('lead') . '
';     } else { } ?>         <?php the_content();?>          <?php endwhile; else: ?>      <?php endif; ?>

         <?php $arg=array(         'post_type' => array ('books'),         'post_status' => array( 'publish'),         'posts_per_page' => 10         );         $arg_query = new WP_Query();         $arg_query->query( $arg );         ?>         <?php if( $arg_query->have_posts() ) : ?>         <?php while( $arg_query->have_posts() ) : $arg_query->the_post(); ?>      >" rel="bookmark" title="">                   <?php endwhile; else : ?>         <?php endif; ?>


How to make multiple sections in home pulling posts category wise?

This question may look foolish to everyone or novice , but i am working on a theme . It will be basically a news publishing theme . Right now , In my home page all posts are showing one after another like a usual WordPress theme. No extra coding has been implemented on the theme . But i want to make different sections on the home page and naming each section as its category's title and pulling the posts from that category and show them in that section . Like other news related themes do by making blocks in their home page and showing posts like " breaking news " , " hot right now " etc I hope you have got the point that i am saying . I have read about custom post types and wp_query posts but i dont have the code exactly i want for this . Any kind of help will be very much appreciated Gratis


Blogname and Blogdescription in Pagelines DMS Options Panel

I am attempting up set up a front end options panel in the pagelines-dms framework, from which users will be able to change the blogname and blogdescription. So far I have set up the form which has the text fields 'blogname' & 'blogdescription' as below               add_filter('pl_sorted_settings_array', 'add_global_panel2');     function add_global_panel2($settings){         $settings['privacy'] = array(             'name' => 'Blog Name',             'icon' => 'icon-eye-open',             'opts' => array(                 // Regular Options Engine                 array(                 'key' => 'blogname',             'type' => 'text',                     'label' => 'blog Name'             ),                 // Regular Options Engine                 array(                     'id'   => 'blogdescription',             'type' => 'text',                     'label' => 'blog description'                      ),             )         );         // Finally we return the new array         return $settings;     }      However, I'm unsure of how to link this up with the wordpress options. I have found the following functions in the pagelines-dms editor.settings.php which I beleive holds the key to my success but I'm unsure how to implement it in the right way:               /*      * This class contains all methods for interacting with WordPress' data system      * It has no dependancy so it can be used as a substitute for WordPress native functions      * The options system inherits from it.      */     class PageLinesData {              function meta($id, $key, $default = false){                  $val = get_post_meta($id, $key, true);                  if( (!$val || $val == '') && $default ){                      $val = $default;                  } elseif( is_array($val) && is_array($default)) {                      $val = wp_parse_args( $val, $default );                  }                  return $val;              }              function meta_update($id, $key, $value){                  update_post_meta($id, $key, $value);              }                   function opt( $key, $default = false, $parse = false ){                  $val = get_option($key);                  if( !$val ){                      $val = $default;                  } elseif( $parse && is_array($val) && is_array($default)) {                      $val = wp_parse_args( $val, $default );                  }                  return $val;              }              function opt_update( $key, $value ){                  update_option($key, $value);              }              function user( $user_id, $key, $default = false ){                  $val = get_user_meta($user_id, $key, true);                  if( !$val ){                      $val = $default;                  } elseif( is_array($val) && is_array($default)) {                      $val = wp_parse_args( $val, $default );                  }                  return $val;              }              function user_update( $user_id, $key, $value ){             update_user_meta( $user_id, $key, $value );         }                    }      (a copy of the entire file can be found here: http://themes.svn.wordpress.org/dms/1.0.2/editor/editor.settings.php) If anyone could help I would be more than grateful. Thanks in advance!


Query Multiple Meta Values and display only when it has both meta values

I've been stuck on a problem for a while now and I can't seem to figure it out. I want to query posts and only display them if their 2 meta values checked contain the ones I have queried. For example: If a post had 123 and 321 then I want them to be displayed. But if it had 123 and 123 then it shouldn't be displayed and vice versa. I have been looking at this code and I cant figure it out:               array(            'key' => 'featured',            'value' => 'yes',            'compare' => 'NOT NULL',         ),      array(            'key' => 'type',            'value' => 'event',            'compare' => 'NOT NULL',         )      So just to clarify:   * if `featured` value is "yes" AND `type` value is "event" => it should be displayed but   * if `featured` value is "yes" AND `type` value is "party" => it **shouldn't** be displayed. Sorry if this doesnt make sense. Thanks, Dazeh.


How to add RSS Icon/link as a widget?

When I search plug-ins for RSS, so many of them are dealing with pulling in RSS feeds. I just want an RSS icon to let people subscribe to my feed? I'm also using FeedBurner. I looked for Feedburner plugins as well, but still confused what is simple and best. Shouldn't all blogs have an RSS icon? Or is that simply a matter of the theme? Seems like the default 2010 theme would even have that.


Suggestions to prepare a site which is 90% based on a plugin that's still on beta stage?

I want to make a forum site which uses the bbPress plugin for Wordpress (it turns Wordpress into a forum platform). The forums say that the beta plugin shouldn't be used in production. I want to get some things done, I thought about some elements that may not be affected by changes in the core of the plugin:   * The graphic design part   * The UI part   * The CSS   * Some features Any other suggestions?


Search posts by ID in admin

I'm looking for a way to search through posts by ID, preferably with support for custom post types. I was hoping there'd be a plugin enabling this functionality, but I've failed to find anything. Any ideas would be greatly appreciated, thank you.


Related Post by category, but not current category child

I need an help with this code. This one works perfectly, but I have this problem I have one category (A) and 2 subcat (C) & (D)... so when I watching the post on a category (C) , I would to show only relative in a category (D). What I Have to add at this code ?? something like "not_in_category > current.. is it possible?? Please help mee :)               <?php $orig_post = $post;     global $post;     $categories = get_the_category();     if ($categories) {     $category_id = array();     foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;          $args=array(     'category__in' => $category_ids,     'post__not_in' => array($post->ID, $ids),     'posts_per_page'=> 3, // Number of related posts that will be shown.     'caller_get_posts'=>1     );


Modify Global Posts Plugin

I am trying to modify a query from wpmudev called global blog posts . I need it to not show any of the default blog posts, the first post on each blog.               $query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts      WHERE blog_public = '1'      AND post_type ='" . $recentglobalpoststype . "'      ORDER BY post_published_stamp      DESC LIMIT " . $recentglobalpostsnumber;      I need to suppress the default blog post from each blog. Any ideas, I tried               $query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts      WHERE blog_public = '1'      AND post_type ='" . $recentglobalpoststype . "'      AND ID <> 1      ORDER BY post_published_stamp      DESC LIMIT " . $recentglobalpostsnumber;


Plugin code will not work properly inside a class

I've written a simple bit of code (cobbled together from various tutorials around the web) that creates a simple meta-box (called 'Subheading') and removes the custom fields from the admin area. It all works fine - until I place the code inside a class. Once I do this, the meta-box stops saving to the database. I suspected it was because I need to define some arguments for the constructor to take, but anything I try fails. I cannot figure out what is going wrong, so any help would be greatly appreciated! Here is the code:               class MySubBoxClass      {           function __construct()         {             add_action( 'add_meta_boxes', array( $this, 'meta_box_add' ) );      //Hooks meta_box_add() onto the add_meta_boxes hook                                                                             add_action( 'save_post', array( $this, 'save_meta_box', 10, 2 ) );   //Hooks save_meta_box() onto the save_post hook                                                                                add_action('admin_init', array( $this, 'remove_custom_meta_boxes') );//Hooks remove_custom_meta_boxes() onto admin_init           }              public function meta_box_add()    //Function that triggers the add_meta_box() Wordpress function          {             add_meta_box( 'meta-box-id', 'SUBHEADING', array($this, 'html_form_func'), 'post', 'normal', 'high' );               //Adds meta box with HTML id "meta-box" to the admin panel in the edit posts screen               //Calls the add_meta_box_cb_function() which creates the HTML form (see below)           }                   public function html_form_func( $object ) //Creates the HTML form and outputs its value if it has one            {               wp_nonce_field( basename( __FILE__ ), 'meta_box_nonce' );                  <label><input type="text" name="subheading" id="meta-box-input" size="144" value="<?php echo get_post_meta( $object->ID, 'subheading', true ); ?>" /></label>                 }              public function save_meta_box( $post_id, $post )          {             //Verifies the nonce before proceeding.             if ( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], basename( __FILE__ ) ) )                 return $post_id;                  //Gets the post type object             $post_type = get_post_type_object( $post->post_type );                       //Assigns '$new_meta_value' variable the value that was newly submitted through the HTML form input named 'subheading'              $new_meta_value = ( isset( $_POST['subheading'] ) ? esc_attr( $_POST['subheading'] ) : '' );                  //Assigns'$meta_key' variable the value 'subheading'               $meta_key = 'subheading';                  //Assigns $meta_value variable the value of the custom field (identified by the key '$meta_key') that is currently              //associated with that post              $meta_value = get_post_meta( $post_id, $meta_key, true );                  //If a new meta value was added and the previous meta value had no value (== ''), add the new meta value             if ( $new_meta_value && $meta_value == '' )                 add_post_meta( $post_id, $meta_key, $new_meta_value, true );                  //If the new meta value does not match the old value, update it             elseif ( $new_meta_value && $new_meta_value != $meta_value )                 update_post_meta( $post_id, $meta_key, $new_meta_value );                  //If there is no new meta value but an old value exists, delete it             //elseif ( $new_meta_value == '' && $meta_value )             //delete_post_meta( $post_id, $meta_key, $meta_value );         }              public function remove_custom_meta_boxes()          {             remove_meta_box('postcustom','post','normal');             remove_meta_box('postcustom','page','normal');         }     }          $MySubBoxClass = new MySubBoxClass;


Can You Export Theme Settings From WordPress Multisite?

I do local WP development on a WordPress Multisite instance. What is the best way to move theme settings from there to the live instance? By theme settings I am talking about widgets and theme options.


Internal Server Error only on frontend and certain admin pages

I'm experiencing an internal server error on a site, but only on the publicly facing site, and on certain pages in the admin section, including posts (`/wp- admin/edit.php`) and anything else accessing `/wp-admin/edit.php` (e.g. pages and custom post types), and media (`/wp-admin/upload.php`). Every other admin page seems to work properly. I realize this is likely a server issue, but it's so strange (some pages are fine, others not), that I thought it would be worth asking about. I've deactivated all plugins and checked the `error_log` files (especially in /wp- admin), but haven't found anything. I should also note that I'm seeing core dump files written to the server each time a page returns an error, but I'm not sure how/if I can analyze those. This did happen after attempting to move the site to a different domain, if that helps. I believe I did everything correctly, but it's possible (and even likely, given the problem) that I didn't.


Editing a PHP file to include a small text piece on every page

I'm building site (dummy site is up at www.teamcoding.ca/corporate) and would like to include in the upper-right hand part of the screen, "Switch to Lifestyle Site" with a link to a different site. My impression is that to do this I need to edit one of my .php files. I tried to edit page.php, full-width-page.php (the template I'm using), but did not see any results. I also tried editing header.php but did not see any results. Any help would be greatly appreciated.


categories of custom post type shows in CMS but not in the frontend webpage

I have created a custom post type "Events" and added the categories function for it. However, the categories only shows in the backend CMS which I can set and add new categories, but no message indicating the category that a event was set for in the front end webpage. How can I make the events categories information shown in the front end webpage? I have copied the code below:               function enable_event_posttype() {         register_post_type( 'events',             array(                 'labels' => array(                     'name' => __( 'Events' ),                     'singular_name' => __( 'Event' ),                     'add_new' => __( 'Add New Event' ),                     'add_new_item' => __( 'Add New Event' ),                     'edit_item' => __( 'Edit Event' ),                     'new_item' => __( 'Add New Event' ),                     'view_item' => __( 'View Event' ),                     'search_items' => __( 'Search Event' ),                     'not_found' => __( 'No events found' ),                     'not_found_in_trash' => __( 'No events found in trash' )                 ),                 'public' => true,                          'supports' => array( 'title', 'editor', 'comments'),                 'capability_type' => 'post',                 'rewrite' => array("slug" => "events"), // Permalinks format                 'menu_icon' => get_bloginfo('stylesheet_directory') . '/images/date.png',  // Icon Path                 'menu_position' => '5'             )         );     }          add_action( 'init', 'enable_event_posttype' );                    add_action( 'init', 'build_taxonomies', 0 );          function build_taxonomies() {       register_taxonomy( 'categories', 'events', array( 'hierarchical' => true,  'label' => 'Categories', 'query_var' => true, 'rewrite' => true ) );     }


Multisite htaccess on localhost with WP as an SVN external?

I've mimicked Otto's setup here: http://ottopress.com/2011/creating-a- wordpress-site-using-svn/ and my brief example is below. That tutorial is specific to a single site install, and specifies a single domain. **How can I customize the`htaccess` below to be suitable for multisite?** Note that the multisite `htaccess` WordPress provides doesn't work because the `wp` directory is custom. **Directory Setup**   * `C:\wamp\www\my_site` - Site root   * `C:\wamp\www\my_site\wp-config.php` - Config   * `C:\wamp\www\my_site\wp` - WordPress as an SVN external   * `C:\wamp\www\my_site\custom-content` - Custom content dir **Apache Setup**               <VirtualHost 127.0.0.1>         ServerName example.com         DocumentRoot "C:/wamp/www/my_site"         ServerAdmin me@example.com              <Directory C:/wamp/www/my_site>             Order Allow,Deny             Allow from all         </Directory>     </VirtualHost>      **htaccess**               Options -Indexes     RewriteEngine on     RewriteCond %{HTTP_HOST} ^(www.)?example.com$     RewriteCond %{REQUEST_URI} !^/wp/     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule ^(.*)$ /wp/$1     RewriteCond %{HTTP_HOST} ^(www.)?example.com$     RewriteRule ^(/)?$ wp/index.php [L]


show custom field content in jquery tabs

I am trying to make a post which will contain several custom fileds. the custom fields should show within jqery tabs. I have already made it in here: http://algodonesdentistreview.com/ahmad/dentists/a-test-dentist-post but the problem is, the tabs aren't dynamic, that is, if I'm adding a field from dashboard, it won't show up in the page. instead, I have to modify the code every time. here's my code:

Profile

Staff

Treatments & Prices

<?php the_field('Profile'); ?>

<?php the_field('Staff'); ?>

<?php the_field('treatments_&_prices'); ?>

      right now, every time i have to add a new field, I need to go back to my single.php and add the html for it. I don't want to do it. I want to just add the custom field and be done with it without going back to my single file. I know what I'm doing wrong, but I'm not much of a coder, so can't find a way to correct it. any help will be much appreciated. BTW, don't know if it's relevant,but the post is also a custom-post. I'm also using the Advanced Custom Post plugin.


Where are wordpress custom types stored?

Where are custom types stored? Because when a custom type is created, in wp_posts, the post type is set to the `<new_custom_post_type>`. But where are the details of the new custom post type stored??


Cannot upload featured image to a custom post type

For some reason I am not able to upload images OR set the Featured Image on a custom post type in my custom wordpress theme. I have added theme support of post-thumbnails to my functions.php file and my custom post type supports it. The link to add the featured image works and it allows me to start uploading the file. But before the file can complete it gives me the error message "An error occurred in the upload. Please try again later". If I visit the media library directly, the file is there, but it shows an error in the custom post page. Also, when I open the media library from the custom post page it shows as empty. Anyone out there have any thoughts on why this is?


How Can I Add Code To A Preexisting Function Without Editing it

This is what I am trying to do:      Lets say I have a parent plugin, Plugin X, and a child plugin (an extension, whose purpose is to enhance X) Y.      There is a function in plugin X that I wish to add code to, from plugin Y. In other words, I am writing plugin Y.      Using WordPress, I know there is a way to override Plugin X's like such:     * remove action plugin X's function      * add action Y's function      * function thatIgotfromXmodified { }       But is there any other way? I don't want to have to modify my plugin everytime Plugin X's author changes the functions code, so that users of my plugin get all the benefits of X's new version.   It looks like if Plugin X's author adds something like an action filter, I can hook into that somehow and add code there? Not sure if it matters or not but the function I am editing is backend code (ie no output to user). Suggestions? Ideas?


Custom post type child page 404

This issue seems to be quite common, but the solutions that worked for others haven't worked for me. I'm using the CPT UI plugin and have created a CPT called 'courses' with the following settings:               register_post_type('courses', array(     'label' => 'Courses',     'description' => '',     'public' => true,     'show_ui' => true,     'show_in_menu' => true,     'capability_type' => 'post',     'map_meta_cap' => true,     'hierarchical' => true,     'rewrite' => array('slug' => 'courses', 'with_front' => true),     'query_var' => true,     'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','post-formats'),     'labels' => array (       'name' => 'Courses',       'singular_name' => 'Course',       'menu_name' => 'Courses',       'add_new' => 'Add Course',       'add_new_item' => 'Add New Course',       'edit' => 'Edit',       'edit_item' => 'Edit Course',       'new_item' => 'New Course',       'view' => 'View Course',       'view_item' => 'View Course',       'search_items' => 'Search Courses',       'not_found' => 'No Courses Found',       'not_found_in_trash' => 'No Courses Found in Trash',       'parent' => 'Parent Course',     )      I then created a page called 'courses' and a specialized page template called 'page-courses.php' and a template called 'single-courses.php' for any posts within the courses custom post type. Up to now everything worked correctly. Next, I created a new page with the slug of 'questions-checkout' and 'courses' as it's parent. It is this page that gives a 404. I've tried the following to get it working:   1. In admin: settings > permalinks and resaved added `flush_rewrite_rules();` to functions.php and refreshed the 'questions-checkout' page    2. Installed 'rewrite rules' plugin and flushed the rewrite rules   3. Created a new custom post type using CPT UI. Using one or more of the above 3 fixes does indeed fix the 404 on 'questions- checkout'. However, I then get a 404 on posts within the courses page e.g. /courses/post-title. No matter how hard I try, it's one or the other that works - I can't get both courses posts and child pages to be 404-free. Strictly speaking, I know that pages should not have the same name as a custom post type, so I suspect this is the cause of the 404. My next approach was to delete the 'courses' page, and its child 'questions-checkout'. Then I changed 'page-courses.php' to 'archive-courses.php' and set 'has_archive' to 'true'. So as it stands, I have a working archive pages and singular pages for my 'courses' custom post type. But how can I now add a page called 'questions- checkout' with the URL /courses/questions-checkout ? I'm using WordPress 3.9.1 multisite.


Display custom taxonomy on my custom post type

Hello I am very new at customizing themes, my problem is that on my new post type "listing" `single-lisiting.php` file I need to change the taxonomy category to be display to 4 new taxonomies: status, location, type, bedroom. The code I have is:                <?php echo __( 'Published in ', THEMENAME );?><?php the_category(", ");  ?>      Do not know how to change it, could someone help me.


Query is not work

I use this codes in my functions.php to track post views.               /* Functions to track Post Views*/      function getPostViews($postID){      $count_key = 'post_views';      $count = get_post_meta($postID, $count_key, true);      if($count==''){         delete_post_meta($postID, $count_key);         add_post_meta($postID, $count_key, '0');         return "0 View";     }     return $count.' view';      }      function setPostViews($postID) {      $count_key = 'post_views';      $count = get_post_meta($postID, $count_key, true);      if($count==''){         $count = 0;         delete_post_meta($postID, $count_key);         add_post_meta($postID, $count_key, '0');     }else{         $count++;         update_post_meta($postID, $count_key, $count);      }      }           /* Track the Views for the post using wp_head hook */      function trackPostViews ($post_id) {      if ( !is_single() ) return;      if ( empty ( $post_id) ) {         global $post;         $post_id = $post->ID;      }      setPostViews($post_id);      }      add_action( 'wp_head', 'trackPostViews');      But i want to display my most viewed post on the sidebar and it is not work. There is dispalyed post but not most viewed. This is my query.                            <?php           function filter_where2($where = '') {      $where .= " AND post_date > '" . date('Y-m-d', strtotime('-10 days')) . "'";      return $where;      }      if ( ! $my_paged = absint( get_query_var( 'paged' ) ) )      $my_paged = 1;           if ( ! $my_query = get_transient( "7677recent_$my_paged" ) )            {     add_filter('posts_where', 'filter_where2');     $my_query = new WP_Query( "meta_key=post_views&orderby=meta_value&order=DESC&posts_per_page=5&paged=$my_paged" );     set_transient( "7677recent_$my_paged", $my_query, 60 * 60 );      }      remove_filter( 'posts_where', 'filter_where2' );      while ($my_query->have_posts()) : $my_query->the_post();       ?>


Is it feasible to build and update a Wordpress website offline?

It appears that Wordpress is designed to have websites constructed and maintained online - in the live website. I see some posts here that indicate some people are doing such development offline - in Localhost. But the effort to move a website online - especially for updates - appears to be complex, somewhat manual, and not at all automated. In fact, it's not clear of just the changes can be moved, or if the entire website would have to be reloaded. This seems complicated by visitor changes to the live website while updates are being created. And backups or version control of content - well I haven't gone far on that yet. So what works? Is it just best to make changes to the live website? What would be the best approach for doing development offline?


Can't change image size from post "Show current page featured image in sidebar"

I added the exact code that you offered in the post Show current page featured image in sidebar. The featured image is displayed, but the size of the image is unaltered from the original. I am creating a child theme for "responsive", and this image is for a page, not a post. I used this code as the first thing in functions.php: add_image_size( 'sidebar_post_thumbnail', 100, 9999, true ); When I insert the image as the featured image, my custom 100px size does not show up as a radio button. Also, I clicked the radio button for the default thumbnail size (150x150). That also had no effect. Any ideas?


How to integrate add_settings_section into WordPress Plugin Boilerplate?

I'm following the _The Complete Guide To The WordPress Settings API_ to integrate the Settings API into the WordPress Plugin Boilerplate. The boilerplate creates a section specifically for adding an options page, doing the initial work of registering a page in the admin menu under the Settings tab. The slug of this page could be "my-first-plugin-settings" or http://www.mysite.com/wp-admin/options-general.php?page=my-first-plugin- settings. The _Complete Guide_ tutorial's first code example is this:               /* ------------------------------------------------------------------------ *       * Setting Registration       * ------------------------------------------------------------------------ */             /**       * Initializes the theme options page by registering the Sections,       * Fields, and Settings.       *       * This function is registered with the 'admin_init' hook.       */       add_action('admin_init', 'sandbox_initialize_theme_options');       function sandbox_initialize_theme_options() {                // First, we register a section. This is necessary since all future options must belong to one.           add_settings_section(               'general_settings_section',         // ID used to identify this section and with which to register options               'Sandbox Options',                  // Title to be displayed on the administration page               'sandbox_general_options_callback', // Callback used to render the description of the section               'general'                           // Page on which to add this section of options           );       } // end sandbox_initialize_theme_options            /* ------------------------------------------------------------------------ *       * Section Callbacks       * ------------------------------------------------------------------------ */             /**       * This function provides a simple description for the General Options page.        *       * It is called from the 'sandbox_initialize_theme_options' function by being passed as a parameter       * in the add_settings_section function.       */       function sandbox_general_options_callback() {           echo '
Select which areas of content you wish to display.
';       } // end sandbox_general_options_callback        My question is what should replace "general" under `add_settings_section()`? Replacing it with "my-first-plugin-settings" does not work. Should it work or am I missing some broader point here?


On Install, which code sets the 'home' option?

I'm just doing some wordpress development and wondered for a brand new install, which code within core is generating the first value that get's filled into the `home` option? I'm looking for the code in core, e.g. the filename and the line where this happens. Does someone remembers from mind?


What is the correct/safe way to delete all comments?

We've inherited a WordPress (3.3.2) site that has 13k pending comments, all of which are spam. To delete all these comments is it sufficient and safe enough to do:               DELETE FROM wp_comments;       DELETE FROM wp_commentmeta;      ...or alternatively `TRUNCATE` both tables in the database?


Subdomain redirects to subdirectory

Supposing I have folder called "support" inside root folder "/public_html". I've added a subdomain in my server's panel so that when going to "support.mydomain.com" it redirects to "mydomain.com/support" The problem is that redirection is reflected on the browser's address bar, and I want to make that subdomain work like "base domain". i.e "support.mydomain.com/folder-inside-support" Is it something to be with .htaccess file?


Get the alphabetical sorted data with wpdb

I have a function in my WP which get the data from database, Here is the function               function thebook_get_provider_types() {         global $wpdb;         static $provider_types;              if (! isset($provider_types)) {             $row = $wpdb->get_row(sprintf('SELECT * FROM wp_postmeta WHERE meta_id = %d', CF_PROVIDER_TYPES));             $provider_types = unserialize($row->meta_value);         }              return $provider_types;     }      Is there any way to get the data by alphabetical sort? I wasn't able to find the related documentation in CODEX, Any help would be greatly appreciated.


Read more button not working

I want the "read more" button to appear to truncate the blog posts. I tried using the button insert shortcode < !--more-->", but it's not showing up. I've tried everything I know how... Can anyone help me?


Adding external field to my post form (admin side) and to post show (frontend side)

I would like to add a "Source" field to my posts form so I can show from where I get the published info. Didn't know if this exists already because I'm just starting with WP. So I do some research and found those:   * http://wordpress.org/support/topic/add-custom-field-to-each-post   * http://codex.wordpress.org/Using_Custom_Fields   * http://idratherbewriting.com/2010/09/11/wordpress-tip-adding-custom-fields-in-posts/ But isn't clear for me. I start with the latest one and install the plugin Custom Field Template as suggested, then go trough the guide but get stopped at step #4 because the code is missing or isn't displayed. Can any help me to advance in there? Also I'm using a custom theme but didn't know where I must write the code mentioned at step #4. Any advice, help? Suggestions are welcome too ;) Cheers and thanks in advance