Showing current taxonomy terms

try this: <?php get_header(); ?> <? // get the current term $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); <div class=”container” role=”main”> <h1 class=”entry-title”><?php echo $term->name; ?></h1> <div class=”entry-content ref”> <?php $loop = new WP_Query( array( ‘post_type’ => ‘references’ , ‘genre’ => $term->slug) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); … Read more

adding a custom css class to post

Note – I recommend using the hook suggested by @Chip Bennett in another answer Here’s the modified version of that filter – function wpse_filter_post_class( $classes ) { $my_post_class = get_post_meta($post->ID, “your_meta_name”); if( $my_post_class != ” ) $classes[] = $my_post_class; return $classes; } add_filter( ‘post_class’, ‘wpse_filter_post_class’ ); You can setup a Custom fileds for that – … Read more

How can I edit a post from the frontend?

Just like the example you linked, but instead of using wp_insert_post() you use: wp_update_post() so your form becomes: <?php $post_to_edit = get_post($post_id); ?> <!– edit Post Form –> <div id=”postbox”> <form id=”new_post” name=”new_post” method=”post” action=””> <p> <label for=”title”>Title</label><br /> <input type=”text” id=”title” value=”<?php echo $post_to_edit->post_title; ?>” tabindex=”1″ size=”20″ name=”title” /> </p> <p> <label for=”description”>Description</label><br /> … Read more

Create Post tabs in single-{content-type}.php with Custom Field values

You can use rewrite endpoints to achieve this. First, register your endpoints: function wpa_movie_endpoints() { add_rewrite_endpoint( ‘synopsis’, EP_PERMALINK ); add_rewrite_endpoint( ‘screens’, EP_PERMALINK ); add_rewrite_endpoint( ‘trailer’, EP_PERMALINK ); } add_action( ‘init’, ‘wpa_movie_endpoints’ ); So now in addition to http://domain.com/post-name/ (or whatever your particular permalink structure is), you’ll have: http://domain.com/post-name/synopsis/ http://domain.com/post-name/screens/ http://domain.com/post-name/trailer/ You can then check for … Read more

Article source link for posts

Thats what meta_boxes are for. First you need to register the metabox within the page or post with the function add_meta_box. Then you want to get that value with get_post_meta on the page where you want the “Source”. This goes into your functions.php file: /* Define the custom box */ add_action( ‘add_meta_boxes’, ‘wpse_source_link’ ); /* … Read more

Open WordPress Posts in Bootstrap Modal

This has been answered and this is how it was done: The grid and the modal window are in a loop. I simply added -<? the_ID(); ?> to bot the <a href> calling the modal window. and to the <div id> for the modal window which somehow passes the post ID to the window allowing … Read more

I am trying to create a simple frontend form for posting

To post from the front-end you can use wp_insert_post() function. So its simply a matter of a form and processing it the form: <!– New Post Form –> <div id=”postbox”> <form id=”new_post” name=”new_post” method=”post” action=””> <p><label for=”title”>Title</label><br /> <input type=”text” id=”title” value=”” tabindex=”1″ size=”20″ name=”title” /> </p> <p><label for=”description”>Description</label><br /> <textarea id=”description” tabindex=”3″ name=”description” cols=”50″ … Read more

Related posts display randomly by tag

Some of the code in OP is a bit old and depreciated, like caller_get_posts which was depreciated years ago. The correct parameter to use now is ignore_sticky_posts. Your query is also really inefficient and not good for performance. Here is how I would tackle this issue Use get_queried_object_id() to get the current post ID instead … Read more

Developing a secure front end posting form

Hopefully the code will be sufficient to describe the key points, but please do comment if you have any further questions: <?php class WPSE_Submit_From_Front { const NONCE_VALUE = ‘front_end_new_post’; const NONCE_FIELD = ‘fenp_nonce’; protected $pluginPath; protected $pluginUrl; protected $errors = array(); protected $data = array(); function __construct() { $this->pluginPath = plugin_dir_path( __file__ ); $this->pluginUrl = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)