Questions tagged [endpoints]

Custom additions to permalinks for any kind of type (archives, posts, root).

Filter by
Sorted by
Tagged with
21
votes
2answers
7k views

How can I use WordPress functions in my stylesheet?

I have my style.php file looking like this. <?php header('Content-Type: text/css');?> #div{ background:<?php echo get_option('bgcolor');?>; } This does not work, but when I do this ...
19
votes
1answer
4k views

Using the Rewrite API to Construct a RESTful URL

I'm trying to generate rewrite rules for a RESTful API. I just want to see if there is a better way to make this work than having to write out every possible rewrite combination. Ok so I have 4 ...
4
votes
1answer
8k views

How to Rewrite Wordpress URL for a Plugin

I am trying to build a Wordpress plugin here with a custom user admin area. What I would like to do is when the user adds /edit at the end of the page, it should open a page from my plugin. So for ...
16
votes
3answers
22k views

Add extra parameters after permalink?

How can I add extra parameters after a permalink, specifically if I'm using a custom post type? For example, let's say http://mysite/album/record-name was the permalink. How can I make http://mysite/...
7
votes
1answer
1k views

Dynamic Endpoints

I have a database table outside WordPress that I need to make endpoints for. I've created a page /cars/ where I plan on using a page template to generate links. I would like for the url to look like /...
3
votes
2answers
1k views

Widget with random posts from a blog for external sites

How can I create a customizable widget with random posts from my blog that can be published on another site as js, iframe or div. Is there any Wordpress plugin for that?
4
votes
2answers
1k views

Make Two Views of Post Type Archive At Two URLs

Updates 6 Feb 14 to make more specific as requested in comments. I have a post type, we'll call it "Projects", with the slug "projects" for which I'd like to offer two views: list view (default) map ...
3
votes
1answer
1k views

Sync posts from one WordPress site to another

I want to achieve the following - I have 2 WordPress sites hosted on different servers. Let's call A as sender site and B as receiver site. Whenever I add/update/delete any post in A, it should be ...
1
vote
1answer
2k views

“rest_no_route” - Debug error

I am using Wordpress 4.9.5 and I want to create a custom endpoint like the following: <?php add_action('rest_api_init', 'miningRigsRoutes'); function miningRigsRoutes() { register_rest_route(...
4
votes
2answers
1k views

Why is my custom API endpoint not working?

I tried to include this code in my plug-in php files as well as in functions.php. (In the end I would like it to be in the plug-in's php file but I'm not yet sure if possible, that would probably be ...