• Resolved webmasterpcsb

    (@webmasterpcsb)


    Hi,

    When I use the permalink shortcode in the notification to display the url for the page, it shows the page id. I have my permalinks setting in WordPress set to Post Name. Is there a way to have the permalink shortcode show the Post name and not the page id#?

    For example, the url displayed from the shortcode would not be:
    https://mysite.com?page_id=208

    but instead be:
    https://mysite.com/test-page

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @webmasterpcsb,
    Thanks for your message.

    This shouldn’t be occurring and I’ve never seen this in my testing or had it reported before unfortunately. My guess would be that something is re-writing URLs somehow but I couldn’t tell you where or how.

    Are you able to investigate this?

    Thanks,
    Jack

    Thread Starter webmasterpcsb

    (@webmasterpcsb)

    I will look into this. I’m not sure what it could be either.

    Thread Starter webmasterpcsb

    (@webmasterpcsb)

    I not sure if it would apply, but we are using a multi-site configuration for WordPress. We use a nginx web server and this is our current configuration:

    server {
      listen 80;
      server_name subdomain.example.com www.subdomain.example.com;
    
      root /var/www/wordpress/public;
      index index.php;
    
      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log;
    
      if (!-e $request_filename) {
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;
        rewrite ^(/[^/]+)?(/wp-.*) $2 last;
        rewrite ^(/[^/]+)?(/.*\.php) $2 last;
      }
    
      location / {
        try_files $uri $uri/ /index.php?$args;
      }
    
      location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
      }
    }
    

    Is there any information that I can provide to verify this issue?

    Thread Starter webmasterpcsb

    (@webmasterpcsb)

    After further investigation, it would appear that it might be a WordPress problem relaying the post name from the get_permalink() function. This would be the type of configuration we are trying to obtain:

    $permalink1 = get_permalink( $post->ID );
    $permalink1 = substr($permalink1, 0, strpos($permalink1, "?")) . $post->post_name;
    $message = str_replace( '[permalink]', $permalink1,  $message );
    

    By editing the /includes/engine/class-bnfw-engine.php with the snippet above, the format we were trying to achieve works.

    This is not the best way to do this. Do you have any recommendations?

    Plugin Author bnfw

    (@voltronik)

    Thanks but that might only work for your specific set-up.

    Can you send a screenshot of Settings > Permalinks for that site?

    Thanks,
    Jack

    Thread Starter webmasterpcsb

    (@webmasterpcsb)

    Here’s the screenshot:
    permalink settings

    Plugin Author bnfw

    (@voltronik)

    Hi @webmasterpcsb,
    The screenshot link doesn’t seem to work for me.

    Can you confirm it’s correct and re-post?

    Thanks,
    Jack

    Thread Starter webmasterpcsb

    (@webmasterpcsb)

    Try this link: Permalinks

    Plugin Author bnfw

    (@voltronik)

    Hi @webmasterpcsb,
    As this is a multisite issue and I plan on addressing Multisite as a separate add-on for BNFW, i’m going to mark this as resolved for now. I’m hoping to have the Multisite add-on out in a few months time providing that everything does well.

    Thanks,
    Jack

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Permalink display as page ID, not post name’ is closed to new replies.