Help With Warning on creating new Post types?
Wherever you’re using _x(‘lorem’), use _x(‘lorem’, ‘models’); instead. Models is actually supposed to be a context, but I don’t know your context, hence using models. Try this.
Wherever you’re using _x(‘lorem’), use _x(‘lorem’, ‘models’); instead. Models is actually supposed to be a context, but I don’t know your context, hence using models. Try this.
In principal, you could use this with any archive page. All it’s doing is fetching the next page of results and displaying the data. The reason it won’t work with CPTs is because of the way the PHP script is queued – with an !is_singular() filter. The core of the plugin is in the JavaScript. … Read more
Try this <?php $related = new WP_Query( ‘tag=’ . get_the_title() . ” ); if( $related->have_posts() ): <h1>Related Articles</h1> while ( $related->have_posts() ) : the_post(); ?> <li><a href=”https://wordpress.stackexchange.com/questions/48774/<?php the_permalink() ?>”><?php the_title(); ?></a> </li> <?php endwhile; else: //there are no related articled endif; wp_reset_postdata();?> EDIT You should not use query_posts for a secondary loop. The query_posts alters … Read more
Actually you don’t need a plugin to do this. Just add a simple function to your functions.php file: function my_content($content) { $content=”My content before post” . $content . ‘My content after post’; return $content; } add_filter(‘the_content’,’my_content’); If you don’t want additional content to appear in your feed, use following function: if( !is_feed() ) { function … Read more
The global $post object is from the current query, so what you’re seeing is the expected behavior. If you always want the shortcode to return the post_meta from ID = 1, then you should just hardcode that into the shortcode like in @Chris_O’s answer where you just save a variable that equals 1 and pass … Read more
function my_admin_notice(){ global $pagenow; if ( $pagenow == ‘post-new.php’ || $pagenow == ‘post.php’) { echo ‘<div class=”error”> <p>This notice only appears on the add and edit post & page.</p> </div>’; } } add_action(‘admin_notices’, ‘my_admin_notice’); http://codex.wordpress.org/Plugin_API/Action_Reference/admin_notices
You pull content normally. You don’t have to specify any id, as page/post will use template it is assigned to, so I don’t really understand your question.
It’s totally up to you to decide to put it as a post or a page. I would put it as a page though. One important difference between them is that Pages are hierarchycal and Posts chronological. You can study each in the Codex to better decide: http://codex.wordpress.org/Posts http://codex.wordpress.org/Pages This can also be usefull: http://codex.wordpress.org/Main_Page#Learn_How_to_Use_WordPress
A search and replace solution does sound viable. I wouldn’t do it via JavaScript, though. add_filter(‘the_title’, ‘wpse60174_logo_in_title’, 10, 2); function wpse60174_logo_in_title($title, $post_id) { // Add a <span> around the company name return preg_replace(‘~\bCompany\s+Name\b~i’, ‘<span class=”company”>$0</span>’, $title); } With the extra span in place it is just a matter of applying some custom styles to it. … Read more
Here’s something I’d use if I want to do that without using plugins Create a custom field as rating and provide the value while doing post. Suppose I gave a rating of 6, Now wordpress save it into the database as. meta_key => rating meta_value => 6 Now to show the rating on post I’ll … Read more