0
votes
2answers
83 views

Add category slug as class attribute in a link array

This incredible website and the genius developers here have helped me significantly in the course of my WP Dev over the years, firstly THANK YOU. I am now faced with a problem that I have been trying ...
0
votes
0answers
43 views

Perform internal redirect in WordPress?

Let say I have an existing page named "bar", e.g. http://www.example.com/bar I want to write a plugin, which when called, will load the content exactly same as bar (not just post_content, but the ...
0
votes
0answers
21 views

Hierarchy of Subcategories on Permalink

I'm new to Wordpress. My current permalink is set to /%category%/%postname%/ and a "." (dot) in the Category base. My categorys ID are bigger than the subcats IDs. So the URL looks like this: ...
0
votes
1answer
27 views

Forward an old url rewrite scheme to a new one?

I have the following url rewrite for custom post type: add_rewrite_rule( 'event/([0-9]+)', 'index.php?post_type=event&p=$matches[1]', 'top' ); Due to a site structure change, I'll ...
0
votes
0answers
129 views

Change permalink based on post category

I am looking for a way to change the permalink structure based on the category a post is in. If the post is in the "blog" category I would like the permalink to be /blog/%postname%/ and if it is any ...
2
votes
3answers
2k views

Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?

I am having a bit of a strange issue with rewrite rules not flushing properly. I have tried using flush_rewrite_rules(); and flush_rewrite_rules(true);. I have also tried globalizing $wp_rewrite ...
1
vote
1answer
263 views

Why doesn't flush_rewrite_rules run on plugin activation?

I'm trying to flush rewrite rules in a plugin and it isn't working. I have to go to permalinks -> save in the admin panel for the rewrites to flush. Can anyone see why? class SpektrixPlugin { public ...
1
vote
1answer
205 views

Publish Post After Click On A Link

I have a frontend posting form (CF7), where user inputs (among other data of course) his email. Now I set the status to pending. What I want is, that the user would get trough autoresponder a mail, ...
1
vote
2answers
205 views

URL rewriting must be activated manually for my plugin

I am creating a Wordpress plugin which create pages (with get_header(), get_footer() and get_sidebar()) for searching through an API. Of course, I have defined some rules for URL rewriting like this: ...
0
votes
2answers
79 views

How to embed a new string in url?

I am creating a custom tours and travel theme in which I have created custom post type Cities, Locations, Destinations and i am using custom permalink structure. /%category%/%postname%/ So now I want ...
0
votes
3answers
522 views

Custom rewrite rules for /pastissues/%category%-%postname%.html

I have been researching this for over a week now. I've tried a few tutorials on custom rewrite rules and custom post types, but I'm still not sure which direction I should go in for making this ...
0
votes
2answers
62 views

How to get the permanent link in a plugin?

I'm writing a plugin to add some extra contents that contain the permanent link to the (single) post. function abcd_add_contents($content) { $extra_content = the_permalink(); if ...
1
vote
3answers
2k views

How to call a plugin function from index.php [closed]

I have created a function in my plugin myplugin with the name foo, how to call it from the frontend? e.g. index.php?
0
votes
2answers
440 views

Make get_permalink() work outside the Loop using filters

I am developing a plugin which displays a wordpress post in a lightbox outside the loop. I noticed that some plugin which modify the contents of the post (like Facebook Like button plugin) use the ...
1
vote
0answers
115 views

permalinks with get variables

I'm trying to create my own permalinks with wordpress rewrite API. I have been registering my get variables as it follows add_filter( 'query_vars','driver_vars' ); function driver_vars( $vars ) { ...
0
votes
1answer
54 views

Get URL of Post You Are Editing

I can't seem to find this anywhere, Is there a way to retrieve the URL of the post (which is of a custom post type) you are editing. Basically I want to somehow get the same URL that shows up like ...
1
vote
2answers
348 views

How to get the permalink of a page when loading my plugin

I'm implementing a web widget and for this reason i'd like my script to respond to the request as soon as possible, to avoid loading unneccessary thing. I've found out that calling get_permalink( ...
0
votes
1answer
99 views

Changing permalink structure breaks link to .php file which generates files dynamically

I'm creating a (calendar) plugin where one feature is the ability to download an event as a .ics-file. To do that I have a file called ics.php in which I generate an .ics-file based on the id of the ...
1
vote
1answer
131 views

add_rewrite_rule behaving strangely

I'm customizing another plugin by changing the rewrite rule, from: add_rewrite_rule('^api/auth/([0-9]+)?/?','index.php?__api=1&uid=$matches[1]','top'); to: ...
0
votes
1answer
143 views

How to use permalink query to go to specific tabs in posts

I'm not really sure how to phrase the questions, but hope it's not too confusing. Basically I've create a plugin which inject custom tabs into the posts content when displaying. For now, just assume ...
0
votes
1answer
336 views

wp_insert_post generated mixed permalinks

I'm writing a plugin which uses wp_insert_post() to insert posts programatically and my permalink setting is /%category%/%postname%/ Of all the post inserted, wp_posts.guid shows 2 types of output. ...
1
vote
1answer
304 views

custom permalink's rewrite rule for page id

I am using WP 3.2.1. I try to do permalink like: /en/1/some-string. Structure is: %lang%/%pageID%/%some random string% So I add a rewrite rule: function nw_lang_addRewrite($aRules) { ...
6
votes
1answer
130 views

Rewriting every url

I have a question regarding permalinks and rewriting url's. I am writing a translation plugin and I would like to add the language shortcode in my url (Something like ...
0
votes
1answer
47 views

How to link to custom “archive like” page with custom permalink rules “dynamically”

I am working on a plugin where I am trying to create a "archive like" page with permalinks. Here is what I have so far: I've created a query var "experience" I've created custom SQL selects using - ...
2
votes
1answer
135 views

Creating a path in a plugin to call a function

Okay, let's assume that I want to create a dynamic "printable" page using a system that doesn't play well with wordpress's theming engine, is there a way for me to define a "permalink" in my plugin ...
0
votes
1answer
304 views

help intercepting save_post through plugin

I use stackoverflow very often and just found out in google about this one, Nice :D Well, i want to save my every post i write from wordpress to my 3rd (OEXChangeble) website aswell at the same time, ...
1
vote
1answer
345 views

Append varible to url or set session

I just wrote a little plugin that detects if the user is on a mobile browser and if so detects them away from the WordPress site to a mobile (simple) version of part of the site. As I got to ...