Linked Questions

0
votes
1answer
714 views

Display Custom Post Type Archive content with Shortcode

So I've created a custom post type filled with Advanced Custom Fields only. There is no "content". I've created a single-custom.php, content-custom.php and archive-custom.php. All looking nice and ...
10
votes
3answers
7k views

Hide other users' posts in admin panel

I intended to run a multi-author site, I don't want the posts from other authors to be shown in /wp-admin/edit.php page. I managed solve this problem by the codes from this thread. The code is like ...
6
votes
6answers
18k views

How to control manual excerpt length?

I have a website in which I need to control the displayed excerpt length. Some of the posts might have manual excerpt so I can't use the excerpt_length filter. I can, of course, use some kind of ...
0
votes
3answers
9k views

Pagination not working on Custom Page Template

I searched a lot on this but I can't figure out why my code is not working. I published a page with slug "blog" that uses a custom built template "page-blog.php" that I build from ...
116
votes
4answers
197k views

How to display SQL query that ran in query?

I have come across a function before that displayed the exact SQL code that was used. In a loop for example, but can't remember. Can anybody tell me that function?
65
votes
8answers
6k views

Refactoring Wordpress to improve memory performance [closed]

I had a close look at Wordpress memory consumption. On my site, it seems that for each page hit 20MB of RAM gets allocated, just to prepare comfy environment for all the plugins to run in. I plotted ...
1
vote
1answer
757 views

Is my child theme working properly

A few days ago I created a child theme of my theme zerif lite. Everything is looking good and there is no problem at all. I just want to know are the created functions.php and style.css files correct ...
71
votes
4answers
32k views

What is the preferred way to add custom javascript files to the site?

I've already added my scripts, but I wanted to know the preferred way. I just put a <script> tag directly in the header.php of my template. Is there a preferred method of inserting external or ...
3
votes
3answers
3k views

Display text if current user has written 1 or more posts in a custom post type

I am trying to display different things to new users that have not created a post versus users who have created a post. I tried this, but it did not work for custom post types (only normal posts) ...
17
votes
4answers
15k views

Loading scripts only if a particular shortcode or widget is present

I needed a way to filter a page/posts content before it was loaded so I could add scripts to the header if a specific shortcode was present. After much searching I came across this on http://...
95
votes
6answers
15k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
0
votes
2answers
145 views

sql for querying post and their category

I'm trying to query the wordpress database for the post and what category they belong in. Is there a sql query that I can use for this? Thanks,
1
vote
3answers
10k views

Can't change permalink url after hitting 'ok' and 'update'

I am trying to change some of the titles of my posts and their respective permalinks. After I edit the title and permalink and click 'ok', the permalink appears to have changed temporarily. However, ...
5
votes
2answers
5k views

Add custom meta to nav menu items

I need to attach meta data to every menu item, with a key 'foo'. Is it possible to do that, without editing core WP? A quick look at the nav-menu files showed that no hooks exist near the place I ...
0
votes
3answers
140 views

Whats causing image quality to be degraded?

I'm currently developing a site - http://www.shoplikeits1999.com/ - and I've been struggling to figure out why image quality is deteriorating in the "product grid" layout (below Newest/Popular/Price/...

15 30 50 per page