1
vote
1answer
33 views

Get current post id in functions.php

I have a wp_localize_script() function in my functions.php where I need to push the current post ID of the current post to a jQuery file. So I was wondering how you can get the current post ID of a ...
0
votes
0answers
34 views

Show Custom Post Type Results

Hopefully someone can help me here. I have a custom post type and with this post type I am able to show the title in a select option. Now what I want to happen is when that title is selected it will ...
0
votes
1answer
44 views

save_post not working

In order to create (or update, whenever a post is updated) a unix-timestamp meta, I used following code to fire on save_post. I pasted this code in functions.php. But I believe this is not working, ...
0
votes
1answer
33 views

When Author add new post change default status to pending

Same as above when Author add new post change default status to pending instead of published
0
votes
1answer
30 views

fire action when post is being edited as well as saved?

I'm trying to fire some code when a page is edited and/or saved. This code works: add_action( 'save_post', 'add_promoted_meta_data' ); function add_promoted_meta_data( $post_id ) { echo ...
0
votes
1answer
42 views

Get post title by Alphabet

I try to call this function to get a list of posts by alphabet. But for some reason i keep getting an error. Call to a member function get_col() on a non-object. What am i doing wrong? {function ...
0
votes
1answer
27 views

Trying to see if page is category or single and displaying title with appropriate heading tag

I'm using a custom theme from ThemeForest and I'm trying to get the custom post php to check and see if the post is on a category or single post. If it's on category, use <h2> for the title (for ...
0
votes
2answers
165 views

How to limit the number of results for all query_posts on mysite

I have a huge number of posts and the pagination with no limits eats my server CPU and ram so I need a function to limit the number of posts for all query_posts on my site and I need this function to ...
0
votes
0answers
48 views

List all recent post by categories at the front page (WordPress MU)

I'm looking how can I put on the network homepage all recent post of my WPMU Network. I tried that script but there are not so much informations (I want the same presentation such as a normal post) : ...
-1
votes
1answer
574 views

List only child categories a post is in, of a specific parent category

Either this is harder than it needs to be or I am just not understanding WordPress/PHP very well :( All I want to do is show the child/sub categories of a specific parent category...but only if the ...
1
vote
1answer
539 views

Set posts of a custom post type to be private by default?

Say I created a custom post type called 'Private Posts' ($post_type = itsme_private_posts) and want all posts under the custom post type to be set to 'Private' automatically when published i.e. by ...
-1
votes
1answer
163 views

Insert Shortcode exactly at the end of the content

<?php echo do_shortcode("[sharethis]"); ?> <?php wp_related_posts()?> There are 2 short codes above 1) share this plugin short code 2) related posts short code now my ...
0
votes
1answer
164 views

saving/reading custom field value does not work - no value gets POSTed

I am trying to add a custom field to all my posts and of course saving/reading the value. As a starting point I took the example from the Wordpress Codex and stripped it down to bare bones. I know it ...
0
votes
1answer
73 views

Guest Author - How to modify my custom function code if the guest author URL will follow a particular pattern/format?

Based on code the awesome G.M. provided in an earlier question (Use Custom Fields to Create Guest Author Link), I now have a custom function that uses custom fields to support guest authors. The code ...
0
votes
0answers
61 views

How to add html div´s inside wordpost?

I need some help. The problem is, I decided to build a match stats which i want to insert in the proper wp posts.I build it with html and css.The issue is when i add the code of it, which contain div ...
0
votes
0answers
121 views

Show post last modified date twentyeleven theme

Here is the code snippet i'm using to display last modified date in my twentyeleven child theme since i frequently update my posts but the problem is search engine is not displaying my post last ...
0
votes
1answer
206 views

Order posts alphabetically: how to set order=asc in mysql query?

I have this function: global $wpdb; // adjust the query to fit your needs $posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ...
0
votes
1answer
179 views

display last post modified date in genesis child themes

Since I frequently update posts so it’s crucial for me to display last modified date instead of post published date like following image. Its because I want search engine to display my post last ...
0
votes
1answer
75 views

Custom colors for post rows based on post meta value

I'm trying to have the post background colors change depending on a meta value for the specific post type rather than using the post status. Looked everywhere and can't find a solution. (perhaps there ...
0
votes
1answer
27 views

Same post appears in related Posts?

Here is the code function dark_delight_get_related_posts(){ $post = get_post(); $args = array( 'posts_per_page' => 4, 'ignore_sticky_posts' => true, ...
1
vote
1answer
50 views

How to assign classes to all elements?

Is it possible to assign classes to elements of certain type? For example, all paragraphs in the post body or comment body should have class="paragraph", all unordered lists in post body should have ...
0
votes
1answer
113 views

How to get new post URL?

I'm wondering... how can I get the new post URL in my theme? Is there a built-in function for this? So, it should return something like http://example.com/wp-admin/post-new.php?post_type=post. ...
0
votes
1answer
135 views

Display author box on just certain category posts?

I'm using this code to display a author box after my blog posts. The issue that I'm having is that it is showing up on all custom post types as well which I don't want. What I need is for it to show ...
0
votes
1answer
28 views

Display post x of y within category

I'm currently using this class in my single blog posts to get a total post count and number my posts (post 89 of 90, etc...) class MY_Post_Numbers { private $count = 0; private $posts = array(); ...
0
votes
2answers
228 views

Notice: Undefined index: suppress_filters

I'm doing some de-bugging on a theme I'm working on and I'm hoping someone can help me please. I used this function that Justin Tadlock made to display custom post types on the blog page and with ...
0
votes
1answer
404 views

Load post attached images on a single page site with fancybox

I'm trying to make a single page site that will display posts as thumbnails in some part. Then if a thumbnail is clicked, I want all the images contained in this post to be loaded with fancybox while ...
0
votes
1answer
81 views

Internal linking to posts permalink fail because of spaces and stripe at postname

I have written a function which outputs a tag in a textarea in which people can link internally to other posts on the website. This works like a charm except with using a postname permalink ...
-1
votes
1answer
53 views

Ajax calls in wordpress

I want to send a ajax request in wordpress which tracks my clicks. For now i have added this in my functions file : add_action('init', 'my_script_enqueuer'); function my_script_enqueuer() { ...
1
vote
1answer
58 views

Force authors to Preview a post before publishing

I'm looking to find a way to force authors (including admin & editors) to preview their post before publishing. Is this possible, if so does anyone know the easiest way to achieve this? I'm ...
0
votes
1answer
86 views

Showing custom post type categories in the menu

here is my custom post type and category: //Register nav register_nav_menus( array( 'main_nav' => 'Main navigation' ) ); //Custom post types add_action( 'init', 'create_post_type' ); function ...
1
vote
1answer
67 views

Changing the post date and time with function

What function can be used to update a post's post date and time to the current date & time?
0
votes
0answers
95 views

User driven content problems

I am trying to build a website that will allow users to post from the front end. I need to be able to have the user enter a title, a category, and tags. For the content of the post, I would ideally ...
0
votes
2answers
399 views

Code to auto expire posts after 30 days

I've tried the plugins that are available in the Wordpress plugins section but they seem to fail miserably. Initially, I used Auto Post Expire By User Role which worked for a time, but for some reason ...
0
votes
0answers
71 views

Press this! not working

I am trying to debug a Press this function on a site {Adult Contents} This issue is, images on the page does not add up and does not show... javascript code for press this button is javascript:var ...
0
votes
1answer
80 views

How can I create a menu items from meta box based on users input

I have created a metabox that takes a name that the user can give as an additional name of their post. I am wondering how I can automatically create a menu item based on the name the user input into ...
0
votes
1answer
296 views

Get post meta retrieving wrong value

I created a custom meta box with a textbox where the user can enter a custom value in as an additional identification tag. I thought I had it right but when I try to retrieve the value it is giving me ...
2
votes
2answers
383 views

How can I add dropdown widget/box to admin post page?

I am trying to figure out how to add a dropdown widget to the post page. The reason I ask is because I would like to be able to have a few different post classes that the user can select while making ...
8
votes
3answers
834 views

How to change the case of all post titles to “Title Case”

I am helping my father with his WordPress website. It has over 1,700 posts with TITLES IN UPPERCASE. We'd like to change these to "Title Case" in the database (possibly using this PHP script). The ...
1
vote
2answers
186 views

Dynamically add id to heading tags

How do I add an id attribute dynamically to every heading tag on a wordpress website using php? I wanted to make it so that for every heading tag (h1, h2, h3, h4, h5, h6) I have a unique id attached ...
0
votes
2answers
98 views

Getting rid of the blog page entirely

My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
1answer
44 views

Have h2 tag not show up if there are no blog posts

On our current site we have different company profiles. Some companies have blog posts that display on their profile and some don't. Their is an h2 tag above posts that is in the page template then ...
0
votes
1answer
127 views

Adding a user's ID behind the <a> tag ref link address

Good day, everyone: I want to make wordpress to add the user's id number behind the ref's link string, so that, for example <div class="toolsbutton"> <a ...
1
vote
1answer
85 views

WordPress Automatic Filename Changer

So I used this function that allows me to change the literal filename in the directory on upload. But, it doesn't actually change the filename, hence changing the slug to the ID when attaching to a ...
0
votes
1answer
49 views

how can authors to define custom pages?

I have a options page and i use this code. I want this, I add author id on sometext field (e.g 3,2,5,11 ) and my author.php redirect custom author page. My author.php <?php $post = ...
0
votes
1answer
96 views

How to add an admin function only to posts, not pages?

I'm having a problem with adding an excerpt counter to the excerpt field. It may be a conflict with another plugin, but basically it screws with other jquery if the excerpt field doesn't exist (e.g.: ...
2
votes
1answer
90 views

How can I list random authors from current post category?

The following lists authors of the current category. But I want this to be a list of 6 random authors from current post category. foreach((get_the_category()) as $category) { $postcat= ...
-1
votes
1answer
101 views

Notifications Bar on home page only

Is it possible to create an "Alert" button that can be turned on and off thru wp-admin. Of course the "Alert" button im asking for is to be published at the main page, but can only be turned on when ...
0
votes
3answers
199 views

Display a custom field rating system in the front end

I have added a content rating system to my platform where the authors can select which audience their post is appropriate for. Currently, these options are available: Unrated G PG ...
1
vote
2answers
301 views

Remove double space after a period

I run a multiple author platform with more than 1000 writers. Most users writer their content externally (Microsoft Word, OpenOffice etc) and paste it into the Visual Editor. Around 20% of the ...
0
votes
1answer
826 views

How to use wp_editor(); in functions.php then retrieve content in the template

I want to use wp_editor(); (custom editor) I've tried several methods but I am lost and I can't get it to save the post and retrieve the content in template How to edit posts with the new wp_editor ...