Can I list a custom post type within another custom post type in the admin area?

Yes, you can. You would need to add a custom field that would store the ID of other post type. I would recommend using a select list. You could try something along these lines: add_action( ‘add_meta_boxes’, ‘wpse_143600_add_box’ ); add_action( ‘save_post’, ‘143600_save_box’ ); //create the metabox function wpse_143600_add_box() { add_meta_box( ‘related_testimonial’, __( ‘Testimonails’, ‘wpse_143600_translation’ ), ‘wpse_143600_testimonial_box’, … Read more

Add a variable in functions.php and call it in single.php

either use global variable in functions.php: global $prevPost; $prevPost = 10; in single.php : global $prevPost; if($prevPost) .. . . . Your code continues. . Second method: define a function in functions.php and call that in single.php in functions.php : function func_prevPost(){ $prevPost = 10; return $prevPost; } in single.php : if(func_prevPost()){ // your code … Read more

Stuck on maintenance mode

Since you are using the W3 total cache plugin, So The HTML code will be cached in the wp-content/cache folder. So Delete Cache folder from wp-content directory. Now remove the function activate_maintenance_mode() and check the site now… If the problem exists , Delete the W3 total Cache Constant from wp-config.php and clear your browser data … Read more

Child theme within a child theme?

You can add a custom functions.php to your child theme. As long as it’s in the child theme folder, it will not be overwritten when you update the parent theme. See http://codex.wordpress.org/Child_Themes. Read the section “Using functions.php”

How do I add Bootstrap and LESS to my migrated WordPress site?

You don’t need to create additional functions, just re-use what you already have and tweak it a bit: function theme_add_bootstrap() { wp_enqueue_style( ‘bootstrap-css’, get_template_directory_uri() . ‘/third_party/bootstrap/css/bootstrap.min.css’ ); wp_enqueue_script( ‘bootstrap-js’, get_template_directory_uri() . ‘/third_party/bootstrap/js/bootstrap.min.js’, array(), ‘3.0.0’, true ); if (WP_ENV === ‘development’) { wp_enqueue_script( ‘lesscss’, get_stylesheet_directory_uri() . ‘/third_party/less-1.5.0.min.js’ ); wp_enqueue_style( ‘style-less’, get_template_directory_uri() . ‘/css/custom.less’ ); } else … Read more

translate the_title() with .po & .mo

Since, ‘the_title()’ is not a static word, you can’t directly translate it. Its value can be dynamic and saved in the database. So, you can either use plugins like ‘WPML’, ‘qTranslate’ or just learn how to do translation for the values which are saved in database.