Permalink instead of page id in Views

Est. Reading: 1 minute
By: pixelsquare
Created: 06/21/2018
Category:
Difficulty: Intermediate

Permalink instead of page id in Views

×Warning: This tutorial was created 2228 days ago. Some of the information may be out of date with more recent versions of Formidable. Please proceed with caution and always perform a backup before adding custom code.

Hi,

You can add [post_id] in your Views but the final address is [site_url]/?p=[post_id]

Add the shortcode in your function file

function get_ps_perm( $atts ){
$atts = shortcode_atts( array(
'id' => 0
), $atts, 'ps_perm' );
return get_permalink($atts['id']);
}
add_shortcode('ps_perm', 'get_ps_perm');

Then use [ps_perm id=[post_id]] in your link like

<a href="[ps_perm id=[post_id]]">your link</a>

Leave a Reply

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crosschevron-leftchevron-rightarrow-right