Tag Info

New answers tagged

1

get_post() returns a post object. So you can try the following $post = get_post( 1571 ); setup_postdata( $post ); the_title(); the_content(); wp_reset_postdata();


0

Since noone responded, here's my solution: I copied my menubar from header.php into a new file called menubar.php and called that file with include("menubar.php");


0

I ended up adding this to my head: <? if (wp_is_mobile()) { include(TEMPLATEPATH . "/mobile/index.php"); return; } ?> And it worked out fine for my purposes.


-1

Found a method! echo '<META HTTP-EQUIV="REFRESH" CONTENT="3">' ;


0

Add below code to your functions.php function add_script_and_style() { // for .css add wp_enqueue_style('my-style', get_template_directory_uri() . '/my_style.css'); // for .js add wp_enqueue_script( 'my-js', get_template_directory_uri() .'/filename.js', false ); } add_action( 'wp_enqueue_scripts', ...


0

CSS links are relative to the current request URI, not your PHP file. Use an absolute path like: <link rel="stylesheet" href="<?php bloginfo( 'template_url' ) ?>/themesubfolder/style.css" />


0

We can change the default behaviour of including posts attached to child categories by mapping the category_name query var (set from pretty permalinks) to category__in (which ignores child categories): function wpse_184127_ignore_category_children( $wp_query ) { if ( $wp_query->is_main_query() && $wp_query->is_category() && $name = ...


0

If you're not seeing the dropdown at all you might need to reload your theme. Try switching to another theme and then switching back.


0

Maybe this will help. <?php /* Template Name: Featured */ get_header(); ?> Regular code here... <?php get_footer(); ?> If one theme works you could try replacing the files in the broken theme and test which file or files are broken. But first save the old files in a separate folder as a backup. Then you would know which file or files are ...


0

You do this with URL Rewriting. Locate your .htaccess file and add this line above # BEGIN WordPress RewriteEngine On RewriteRule ^author/(.*)$ /team/$1 [R=301,NC,L] Note, if you put this inside the wordpress block it will get rewritten next time your permalinks are regenerated.


2

You need to look how page templates are saved against a page in the wp_postmeta table. Each page is linked to the specific template it uses and this is saved under the meta key _wp_page_template. You can go and have a look at your own install how you db structure looks like and how page templates are save Wordpress does not use page slugs or page names but ...


3

The template name is defined inside the file, this way: <?php /* Template Name: My Custom Page */ This page will tell you all : https://codex.wordpress.org/Page_Templates


1

Add new file called taxonomy- mytaxonomies.php and put you code . But so far I know to add like in page..it is not available in wp yet


0

You're on the right track, but you didn't actually comment out anything in your edits. When you added <?php /* ?>, you're creating a PHP comment just fine, but then closing the PHP tag, which some interpreters will cause to close the comments as well. Instead, either, wrap the HTML you want eliminated in HTML comments or just delete it entirely: ...



Top 50 recent answers are included