Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

moinmobility

@moinmobility
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Wordpress shortcode prints wrong value from custom post type
    M moinmobility

    Hey guys, I run into a problem with developing a new project of mine, more specifically with a shortcode of mine. About the website setup: - I use wordpress - I use Elementors template option to print out a template on on all pages belonging to the taxonomy "Marken". - Custom post types are created with CPT UI and custom fields with ACF I got the following shortcode, to print out the specific brand on the site iteself:

    add_shortcode( 'MODELL', 'modell_shortcode' );
    function modell_shortcode() {
    $terms = get_the_terms( array(
    'post_type' => 'fahrzeuge',
    'taxonomy' => 'marken',
    'hide_empty' => false,
    ) );
    return ucwords($terms[1]->slug);
    }

    The code works fine put prints out the wrong brand. As you can see here Tesla – moinmobility.de[^] "Tesla" should be written in the text above but "Audi" is shown. The same issue applies for the other shortcodes there should be written "0 €" instead of "345 €" etc. Is this a problem with my shortcode? With Elementor? And how to fix this? Searched a lot on Google, Blogposts and Forums but couldn't find a helpful answear. Hope someone here can help me :)

    Linux, Apache, MySQL, PHP help php design data-structures tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups