All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
5k views

How to hide a post from 'Recent Posts' widget?

I'm trying to hide a post from the 'Recent Posts' widget in the sidebar. I know I can do this with the 'Special Recent Posts' plugin, but that plugin really uses up a lot of resources. I've got the '...
0
votes
1answer
1k views

get_the_term_list() display in ul li and remove <a> tag

I want to remove tag in get_the_term_list() <?php echo '<ul class="styles">'; echo get_the_term_list( $post->ID, 'portfolioType', '<li>', ',</li><li>', '</li>' );...
1
vote
2answers
1k views

Connect another DB and fetch records from some tables

I want to connect with another wp db & then fetch records from new connected db then close that db. I follow How can I connect to another WP database and use WP_Query? but after connect to new db ...
0
votes
2answers
44 views

Not the typical order by posts by date question

I am using WP_Query to get all posts from a custom post type. This works great for listing out all the posts. However, the post itself has a custom date field and I want to list all posts for a ...
0
votes
1answer
41 views

Import existing image as a single post

I want to add a bunch of existing images on the server but I want each of them added as a separate post instead of all images into one post. How can I do this?
1
vote
1answer
2k views

Show Posts From Same Category OR Same Tag

Assume a post is categorized in "Fruit" and tagged with "Apple". The following code shows posts with category "Fruit" AND tag "Apple" $args = array( 'tag__in' => $tag_in, 'category__in'...
2
votes
1answer
7k views

WP deregister, register and enqueue dequeue

a plugin that I bought is loading a few js and css files on all pages, so I wanted to write a new function to deregister the handles, and enqueu them where I wanted. however I am not sure If I have to ...
0
votes
1answer
336 views

fetch_feed function works on template index.php but not in plugin/wp-admin

I am using fetch_feed and basically have the same code as the great example provided here but I am creating new posts from the content instead of displaying it afterwards. The errors I am seeing are: ...
0
votes
1answer
73 views

index.php isn't front page but shows as it is

I am working on a website and I am using front-page.php from the 2012 theme as my front page. I set it up that way in settings and set a blank page as the blog in settings. So for the blog, it ...
0
votes
1answer
222 views

How does wordpress add 'style' attribute to <a> element

In my post the html code is like this: <p><a href="http://mysite.com/xxx/xxx/xxx/mypic.jpg"><img class=" wp-image-124 aligncenter" alt="xxxx" src="http://mysite.com/xxx/xxx/xxx/mypic....
2
votes
1answer
138 views

Overriding a function in wordpress

A theme that I bought is adding unnecessary inline JS code that is not needed in the front page. /* Scripts - dynamic css */ add_action('wp_footer', 'upme_custom_scripts'); function ...
0
votes
1answer
175 views

How to correct Error: message on website Twitter Feed

I'm receiving a Error: Twitter did not respond. Please wait a few minutes and refresh this page message on my website at www.toan.ca. This has been going on for a few days and i would like to know ...
6
votes
2answers
1k views

Export specific menu [duplicate]

How can I export a specific menu out of wordpress? I have a list with many URLs and I need to copy it to multiple sites. But I don't want to do it manually.
0
votes
1answer
46 views

How can I only display one link rather than many?

So using this snippet: <?php foreach((get_the_category()) as $childcat) { if (cat_is_ancestor_of(10, $childcat)) { echo '<a href="'.get_category_link($childcat->cat_ID).'">'; echo $...
1
vote
3answers
456 views

Why Won't Exported Blog From One Site Import Into New Site?

I have an old RHEL Workstation site, running the latest wordpress version 3.5.1. I have a newer CentOS 6.4 site, running the latest wordpess version 3.5.1. I have added the Wordpress import plugin ...
-2
votes
1answer
156 views

Show/Hide Featured Image or replace it with custom field [closed]

I want in the place of the featured image of a post -depending on the subject of the post-, to show shortcodes (example shortcode to put on custom field:[ngg_images gallery_ids="1" display_type="...
0
votes
2answers
638 views

Ajax functions - no access to wp-admin.php only online

I'm having some trouble with my custom ajax function. I have this on my console log : "POST MYSITEURL/wp-admin/admin-ajax.php 302 Found". So my functions won't work... And I really don't understand ...
0
votes
2answers
504 views

Adding a tag to wp_nav_menu

I am using wp_nav_menu and I have a need for custom implementation. The default markup is like this: <ul> <li id="menu-item-59" class="menu-item menu-item-type-post_type menu-item-object-...
0
votes
1answer
100 views

Additional .htaccess rules based on wp page

I've created a page in the dashboard called Authors, created a new template-authors.php with completely own logic. It works well, going to website.com/authors/ I see a list of all authors, specifying ...
5
votes
1answer
10k views

Apply the_content filter to a custom field with multiple values

I have a custom meta box set up that allows users to paste the Youtube URL of a video so that it can be embedded into a post/page. The meta box can be repeated so that a user can add as few or as ...
1
vote
1answer
588 views

Auto-fill Custom comment fields

Thank you for reading, I added custom fields to the comment form, and saved the input in the DB, following this tutorial http://wp.smashingmagazine.com/2012/05/08/adding-custom-fields-in-wordpress-...
0
votes
1answer
1k views

cloning a WP_Query

I'm working with several nested loops in order to create a statistics table for teams in a league and I'm having trouble getting my original query back. I've read that I should clone the original ...
0
votes
1answer
820 views

wpdb get_var is not returning any result (verified mysql query returns only one value)

I'm trying to modify a wordpress plugin to make it more adaptable for our needs. I have a custom user_meta called practice and we separate our users based on practice, so we need to separate quiz ...
15
votes
2answers
15k views

How to programatically change username (user_login)?

As in the title, how to programatically change user's login? I wanted to use wp_insert_user function, but it appears that when updating current user, it doesn't change their username. Should I use $...
3
votes
1answer
732 views

Hide allow trackbacks/pingbacks

Under the discussion tab on the post page, there's 'allow comments' and 'allow trackbacks and pingbacks', how would I hide the option to allow pingbacks from users but still have it be on by default?
0
votes
1answer
2k views

Shortcode strips formatting and returns at content top

Using the Advanced Custom Fields plugin and I've got a shortcode going for a repeater field, but it returns the list at the content top. I changed it from an echo to a return, which I understood would ...
0
votes
1answer
459 views

how do I add role and capability after I create a new user

I have a simple requirement: 1. create a user 2. create a role for the user 3. add capability for the role First, create a new user $uid = wp_insert_user($userdata); Second & Third, create a ...
0
votes
1answer
1k views

How to display custom post type only on a certain page?

I have created a custom post type called 'project'. But how do I get the custom post types to display only on my main template? It's a one page website and I don't want it to direct the visitor to a ...
7
votes
5answers
20k views

what's the meaning of the field wp_capabilities in table wp_usermeta

I am new to wordpress, in table wp_usermeta I notice that we have a row meta_key meta_value wp_capabilities a:1:{s:13:"administrator";b:1;} First, what's the meaning of ...
6
votes
3answers
3k views

Custom Post Type and Taxonomy URL rewrite

I'm creating custom theme for my personal website using Wordpress 3.5.1. I have problem with the WordPress custom post type and taxonomy, here's the detail: custom post type name: articles taxonomy ...
0
votes
1answer
512 views

Show Custom Post From Logged In Author

I have a custom home page set up so soon as users log in they see an overview of their account. I want to show them all of their own posts but im having trouble and can only get it to show current ...
1
vote
3answers
3k views

Undefined property: WP_Query::$post

I am working on some rather elaborate comparisons between metadata and having a bit of trouble correctly referring to results from my query. The first query to establish $team_is_home works fine but ...
0
votes
2answers
363 views

Exclude 2 in 3 terms of A Taxonomy from all Archives

I have read this post: Include and Exclude Taxonomies From Archives & Feeds Using 'pre_get_posts' And then I have used that function to my theme. My Taxonomy (tinh-trang) had 3 term: 19,...
0
votes
2answers
3k views

add_post_meta — not working

I am trying to insert data into wp_post and wp_postmeta tables but it seems like i am doing something wrong. Here is my code: $post_data = array( 'post_title' =&...
0
votes
1answer
205 views

MySQL database migration to WordPress

I have a MySQL database established for a web application I have been working on in a non WordPress database. This database has many tables with pre-populated rows for foreign keys etc. which took a ...
0
votes
1answer
131 views

Convert featured images into “product images”

I am developing a large ecommerce site using Wordpress and WP Ecommerce plugin. I recently overhauled the theme and framework. Where as before I was only required to set a featured image for a product,...
0
votes
2answers
41 views

Dark Bar at the top of wordpress page can't be seen?

I am new to wordpress and created a website as shown in the picture bellow. My webpage used to have a black bar at the top, which allowed me to insert "New Posts". (area shown in red circle). But this ...
3
votes
2answers
14k views

Adding unit ammount after WooCommerce price. Example $ 24 /m2 and $24 / m

So hey guys, I'm trying to get my WooCommerce price per unit done. Some of the items I'm selling are floortiles, and as of such they're sold per square metre. I have added the following code to ...
1
vote
0answers
619 views

Ignoring slug capitalization on rewrite rule for custom post type archive page

I'm declaring a custom post type 'games' with a rewrite rule: 'rewrite' => array('slug' => 'Games','with_front' => false), So the resulting url for the games archive is <mysite>.com/...
0
votes
2answers
111 views

register and insert category manually

I am registering custom taxonomies .... <?php add_action( 'init', 'create_book_tax' ); function create_book_tax() { register_taxonomy( 'genre', 'product', array( ...
0
votes
1answer
2k views

Javascript on Registration Page

I've been trying to figure out how to implement javascript on my registration page with no luck. I've read the documentation on wordpress about properly including js, have searched for relevant ...
1
vote
0answers
551 views

Cleaning up bloated wp_postmeta table by removing multiple _thumbnail_id's?

On a very old site (7 yrs) with a lot of posts (30k) I've been trying to whittle down the database tables. The postmeta table is 1.5m rows, 750k of those rows are for a meta_key named '_thumbnail_id'....
0
votes
1answer
337 views

View list of all attachments on site

I'm new to WordPress theme development and I'm trying to figure out if there is a way to display a list of public attachments similar to how you can view a list of posts with a specific tag or author. ...
0
votes
0answers
36 views

homepage olderposts link showing page not found

I am using WordPress 3.5.1 version, now I had a problem with olderposts link present at bottom of homepage. it is ok with rest of the category pages. I am working on this problem since last two days, ...
2
votes
3answers
5k views

How do I disable a plugin enforced by my host (in mu-plugins)?

My host makes mandatory two plugins which get automatic updates under mu-plugins folder. Is there a way I can disable them with some trick, for example with a plugin folder of the same name under my ...
0
votes
1answer
940 views

Front end posting

This source works with image upload. Without image upload, it works, but 'redirect' doesn't work. What should I do?? Any suggestions to what the problem might be? if( 'POST' == $_SERVER['...
0
votes
1answer
677 views

How can I only display links from a child category

Using this code from the codex: <?php $category = get_the_category(); if($category[0]){ echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'&...
3
votes
1answer
1k views

Custom admin columns for ALL custom post types

I have the following function which is working perfectly for my 'video' custom post type to display customized columns in the dashboard. I have decided the way my plugin will work is to have custom ...
0
votes
1answer
232 views

conditional: if is page, and all subpages

What I'm currently trying to achieve is displaying certain menus on certain pages using one template and conditional statements, like so: if (is_page('donate')){ wp_nav_menu(array( 'menu' ...
0
votes
0answers
681 views

Comments appear in wrong posts

Nasty problem here! Comments are not connected to the right posts but to other ones! Passing from disquss to jetpack comments doesnt't fix this. What could be the solution? The site is http://www....

15 30 50 per page