Tag Info

New answers tagged

1

For any other readers I'd like to add in advance that this only really makes sense if you are kind of creating drafts or templates or whatever you want to call it that will be changed later on. Otherwise you'll at least deal with SEO penalties due to duplicate content. Unfortunately this functionality isn't part of WordPress by default so you'd need to find ...


0

Run A Query to Delete All posts before Import Because menus and pages are custom post types, this will update all posts, pages, and menus to be replaced by your import file. Delete all posts in the target server by running a database query. Note that the code requires setting a userid. modify it if there are more users or run it more than once. ...


0

Run A Query to Delete All Staging Posts before Importing From Dev Because menus and pages are custom post types, this will update all posts, pages, and menus to match your dev site. Delete all posts in the staging server by running a database query. Note that the code requires setting a userid. modify it if there are more users or run it more than once. ...


0

I recommend a tool like firebug (http://getfirebug.com/). It will give you the precise values and locations of the applicable css-styles in your style.css. If you use the same file in both installations there should be no differences except for different content or different devices.


1

Do the sites have different wordpress installs? If so, they probably have different names and you could use <div class="different-content"> if (get_bloginfo('name') == "site-1") { // show stuff for blog named "site-1" } elseif (get_bloginfo('name') == "site-2") { // show stuff for blog named "site-2" } else { //if it's not any of the sites ...


1

You'll want a post type of type book, with a custom taxonomy for the publisher series. Use post meta for the books data. The UI will be provided by Core As a refresher: Things/objects/entities are post types We classify things using taxonomies. If you can filter by X, then X is a taxonomy, e.g. colour, type, size, shape, manufacturer, etc Attributes that ...


0

I figured out that way to solve my problem. Just get post format then get the content by using get_post_meta($post->ID, 'variable_name', true); Example: <article class="post post-<?php echo $postformat; ?>"> <?php if( $postformat == "video" ){ $embed_video_code = get_post_meta($post->ID, 'video_embed_code', ...


0

$return_string .= get_the_post_thumbnail(); should be: $return_string .= get_the_post_thumbnail( get_the_ID() );


0

So to move the title below the content just move the html. <article> <div class="entry-content"> <?php the_content(); ?> </div> <!-- end entry-content --> <div class="entry-header"> <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ...


0

You have two big issues here are a few minor ones and some room for improvement. Lets look at your major mistakes first What you have done well is to add your output to a variable and then returning the variable in the end. Shortcodes should always return their output, not echo it. What you have done wrong here is to use the wrong template tags. The the_* ...


0

Just add bellow code into function.php file. function add_author_content($content) { $author = get_the_author(); $content = $content.' - '.$author; return $content; } add_filter('the_content', 'add_author_content');


0

you can do with the_content filter. add_filter( 'the_content', 'my_the_content_filter', 20 ); function my_the_content_filter( $content ) { if ( is_single() ) { $content = $content . "YOUR_HTML_FOR_BOX"; } // Returns the content. return $content; }


0

I've not tested your code; but assuming it's correct and working well, edit your single.php file and insert this code just after the point where you end your post content and before the Comment Section starts. I'd suggest to write this Author Box code in a separate file and then use get_template_part to insert the Author Box section in your Post. See this ...


-1

<?php function custom_content_after_post($content){ global $post; if (is_single()) { $category = wp_get_post_categories( $post->ID, array('fields' => 'slug') ); /** * now let say you know the category slug */ switch($category){ case 'category1': $content .='the signature of the cateogry 1'; break; ...



Top 50 recent answers are included