Tagged Questions
0
votes
1answer
19 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
12 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
18 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
26 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
27 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
22 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
25 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
25 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
19 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
55 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
49 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
55 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
44 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
78 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
76 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
194 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
56 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
59 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
35 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
43 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
0answers
31 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
35 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
64 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
72 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
75 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
93 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
189 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
443 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 ...
2
votes
1answer
382 views
Multiple Content Block
I'm trying to create a custom post type and would like that post type to have two content blocks. So that in the loop I can ask for content-1 and content-2 separately.
I can write the code just ...
0
votes
1answer
109 views
The_excerpt() doesn't parse <!--more--> - how to change that?
I'm using the_excerpt(); in blog.php file (post listing page) and it doesn't recognize <!--more--> if "Excerpt" field is empty and it grabs the beginning of the content as excerpt.
This issue ...
3
votes
1answer
196 views
Restrict users from editing post based on the age of the post
How can I restrict users (based on Capabilities) from editing their published posts after a custom amount of time.
For instance, a user that can publish_posts (authors) can not edit a their post if ...
-1
votes
1answer
203 views
wp trim function not working
Ok i have this code currently.
<?php
query_posts('category_name=widgets2');
echo "<div id='widgets-wrapper2'><div id='marginwidgets' style='overflow: auto; max- width: 100%; height: ...
1
vote
2answers
931 views
How to call function within a page/post, to dynamically generate content?
I added the following function to the file functions.php
function contentGenerator($param) {
if($param) {
echo "Content true";
} else {
echo "Content false";
}
}
How can I call ...
0
votes
2answers
130 views
Wordpress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
I wonder if Wordpress is the best CMS or solution for what I wannt to do?
I need to find some way to upload images to a post that I can loop as background images. Just like I can upload multiple ...
1
vote
2answers
2k views
Limit access to posts/pages by user roles
I'm looking for a way to protect content by user roles.
Example:
you have to be registered to view posts (frontend).
If a user is a subscriber he can read post 1, 2 and 3, but if the user is a ...
3
votes
2answers
708 views
How to detect single.php (but not single-portfolio.php)?
When I'm using is_single(); in my <head> section to add some style to website navigation it executes correctly on blog posts but it also executes on single "portfolio" post type posts (so ...
0
votes
1answer
420 views
Getting the post_id in wp_ajax function
I wrote a custom AJAX function in which I have assigned a post type to be a child of another post type. In one function I am looping through those child posts, and I want to update the database to ...
0
votes
0answers
58 views
if post in category to function [closed]
Hey guys, please please help :)
I have a function in this pastie code http://www.pastie.org/4276093 and I need to place this piece of code:
<?php if (in_category('featured')) : ?>
<a ...
0
votes
2answers
181 views
How to only publish posts with image in it
I use a standard loop in my index.php and that shows all the posts beeing posted. What i'm looking for is a code that only shows the posts that have image(s) in it.
With other words: i only want to ...
0
votes
1answer
113 views
Making a wordpress page print friendly
I'm trying to use an existing plugin in order to make my posts print friendly. I haven't got any support from the plugin developer. I think I have narrowed down the script to the function that places ...
0
votes
1answer
189 views
$post object is null
I am trying to use the $post object from functions.php in my theme however if I attempt to var_dump($post) it returns NULL.
Here is my code:
function breadcrumb_navigation() {
var_dump($post);
...
0
votes
1answer
100 views
List direct children of page
I am currently using the following function to list the children of a page, however the function recursively finds children of the children and I only want to list the direct children of ...
0
votes
1answer
542 views
Disable single post page
Is there a way to disable single post page, for example when some tries to go to single post page to show 404 page.
0
votes
1answer
61 views
Run a function when post is deleted?
Is it possible to run a function every time a post is deleted. The function has to be run when the post is deleted from the admin or by the wp_delete_post() function.
0
votes
2answers
929 views
delete post also attachments
I am trying to delete a post with its all attachments. This is the function that i came up with right now;
function remove_post(){
if(isset($_POST['post_id']) && ...
1
vote
2answers
678 views
Manually set global $post vars with an ID, in order to use template tags
I have a function retrieving ID's of posts by very specific means.
I need to be able to set the global $post in order to use functions like the_content(), which does not allow an ID as a parameter.
...
3
votes
3answers
810 views
How to publish a post with empty title and empty content?
Why I'm doing this you might ask? I'm developing a website for a business with a portfolio where the gallery items are posts. These posts are populated through custom fields and category selections, ...
0
votes
1answer
38 views
Isn't the way posts are displayed very unefficient?
I'm pretty much a WP newbie, and I've noticed that in a lot of themes, there is the exact same code for displaying posts in three different places (single.php, archive.php, index.php etc)
This just ...
0
votes
1answer
72 views
New post is added with the same title as a old post the old post is removed and new post is kept [closed]
I'm using this function to make sure there is no duplicate post or pages with the same title. But the problem is when i add a new post with the same title as a old post the new post that I'm adding is ...
0
votes
1answer
46 views
How *not* to show the last post on the latest posts list
An image speaks for a thousand words so please bear with me:
http://interativo.modateca-sc.com/
The last post appears twice. Once as the feature post and then again on the "main blog part" where the ...



