Template tags for Buddypress
I think you probably want to use bp_core_get_user_domain(); I think bp_core_get_userurl() was taken out after the first release of BuddyPress.
I think you probably want to use bp_core_get_user_domain(); I think bp_core_get_userurl() was taken out after the first release of BuddyPress.
This might work: add_filter(‘page_template’, ‘custom_page_template’); function custom_page_template($template){ // check your permalink here if(get_query_var(‘pagename’) === ‘stories’) return locate_template(array(‘page2.php’, ‘page.php’)); return $template; }
Use the following code, replacing the number after “child_of=” to the id of the parent page. <?php $count = 0; $pages = get_pages(‘child_of=681&depth=1’); foreach($pages as $page) { $count++; } echo $count; ?> Reference: get_pages
There are indeed some frameworks WP Alchemy Rilwis Meta Box Class etc… google will lead your way, as well as the in site search for both packages.
I’m making a couple of assumptions about how your theme is setup: You have two files: index.php. This is the file that begins the execution of the loop. content.php. This is the file in which your generic content template exists. You are familiar with get_template_part(). If not, it’s easy to implement. For example purposes, I … Read more
WordPress does not allow adding files though the admin side of things, therefore you will need FTP or SSH access to the server to add a file to your theme directory at least to initially add the template then you can edit it though your hearts content in the admin. (there may be a plugin … Read more
You would require the path to wp-blog-header.php to access WordPress functionality in a standalone PHP file. So your justthemenu.php file should contain the following code. <?php require(‘/wp-blog-header.php’); wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
function wpse450_show_video( $atts ) { extract(shortcode_atts(array( ‘id’ => 0 ), $atts )); if( is_numeric($id) ) { $ngvideo_title = get_the_title($id); } ob_start(); include ‘path/to/file/video.php’; return ob_get_clean(); } add_shortcode( ‘ngvideo’, ‘wpse450_show_video’ ); You can use $id, $atts in our file as you would in your function. The code in your file will behave just like it would … Read more
Two options: Use conditional code inside of 404.php, to output different content/markup for the post-type Intercept the template at template_redirect, and include a separate template file for a 404 for the post-type. Personally, I’d go with option 1, as it is easier and more intuitive.
This might work for you, trying to hook early to the_content filter to strip the shortcode tag from it: add_filter(‘the_content’, ‘ad_filter_the_content’,1,1); function ad_filter_the_content($content) { // specify page id or array of page ids to include if (is_page(5)) { return str_replace(‘[orbit-slider category=”test”]’, ”, $content); } return $content; }