Giter VIP home page Giter VIP logo

acf-permalink's Introduction

ACF Permalinks

Plugin allows to use ACF values in permalink structure by adding %field_fieldname%, for posts, pages and custom post types. This is an extenion for the plugin Custom Fields Permalink 2.

Build Status codecov

Description

Plugin allows to use ACF values in permalink structure by adding %field_fieldname%, for posts, pages and custom post types. This is an extenion for the plugin Custom Fields Permalink 2.

Screenshot

Examples:

  • http://example.com/%field_event_date_from%/%postname%/
  • http://example.com/post-type/%field_event_date_from%/%postname%/ (with Custom Post Type Permalinks plugin)

You can also set different permalink structure depending on custom post type using Custom Post Type Permalinks plugin. You can create own post types by using Custom Post Type UI plugin.

The plugin works for:

  • posts
  • pages
  • custom post types

Plugin is also avaliable on GitHub: https://github.com/athlan/acf-permalink

Supported ACF Fields

Plugin supoorts many fields:

  • Text fields
  • Checkbox
  • Radio
  • Date Picker
  • Post Object, Page Link
  • User

Full usage samples are included in Supported ACF Fields wiki page.

Installation

  1. Search for ACF Permalinks or follow the link https://wordpress.org/plugins/acf-permalinks/

  2. Install "Custom Fields Permalink 2" plugin. https://wordpress.org/plugins/custom-fields-permalink-redux/

Of course you need to have Advanced Custom Fields plugin installed. https://wordpress.org/plugins/advanced-custom-fields/

Changelog

Release notes: https://github.com/athlan/acf-permalink/releases

acf-permalink's People

Contributors

athlan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

acf-permalink's Issues

How do you use multiple date parts?

Hi,

Firstly an excellent plugin. I might be missing the obvious here, please point it out if I am.

I have an event post type, with a field event_date. I would like each event to have the permalink structure:

mysite/events/YEAR/MONTH/POST

i.e. mysite/events/2018/november/myevent

So using this plugin, in the permalinks settings I enter for the events permalink:

/%field_event_date(year)%/%field_event_date(format=F)%/%postname%/

This doesn't work, the permalink is set to:

mysite/events/2018-12-13/test-event/

It clearly has picked the date out, 13 Dec 2018. However not what I expected. doing it without the month,

/%field_event_date(year)%/%postname%/

seems to work fine and results in:

mysite/events/2018/test-event/

So question is, am I doing something wrong, or is this not possible?

Does not work properly in query parameter

I am trying to set up a Post Type where the dynamic aspect of the permalink is a query parameter

reports/?type=annual&y=%postname%

where postname is going to be my year. It almost works in the preview of the link up top but still appends another postname at the end, and then the actual link still contains the string %postname%

Note the permalink up top and the link preview bottom left

Screen Shot 2023-11-15 at 3 22 34 PM

Using Options Page

Is there any way it can pull data for generating the URL from the ACF options page instead of individual posts / pages?

Stripping characters from the AFC field

When I used this plugin together with ACF to append some text to the end of the permalink, it is adding the text but its stripping out things like ? or = from the text, so I cant get the correct URL. Is this a limitation or bug in the plugin or am I doing something wrong ?

example of the text I am trying to append to the permalink

?_news_product=d2

I end up with _news_productd2

Using plugin break nested pages

Hi,

This plugin works perfectly with the custom fields for posts and custom post types, however, there's what seems to be a bug where nested pages go to a 404 when this plugin is active.

Any ideas why this might be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.