Skip Navigation

[Resolved] Views button not in WPEdit

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 12 replies, has 2 voices.

Last updated by Conrad 7 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#522244
Screen Shot 2017-05-09 at 2.11.23 PM.png

I am trying to: insert a view into a normal WordPress content post.

I expected to see: a Views button in the WPEdit WYSISYG editor.
(I get the conditional button, but am expecting to see some Views button so I just make an exsiting view show up within that post).

Instead, I got: not there.

#522260

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Conrad,

Thank you for contacting our support forum.

The buttons should appear once our plugins are enabled. If not then there might be some custom code or plugin causing this to not appear.

Could you temporarily disable all your non-toolset plugins as a test just to ensure that this is not a plugin conflict.

Once you have done this please let me know.
Thanks,
Shane

#522267

Maybe the quickest way is just to let me know what the shortcode is...

I just want this view to show up in the content of some post:
hidden link

I have that View displaying as a widget on this post:
hidden link
(it's the headlines with the thin image backgrounds)
But I need it to appear in the content, not as a widget above or below the content.

So if I know the shortcode, I probably don't even need that button to work. (Disabling all my plugins to troubleshoot is kinda hard as I have a lot of staff working).

Thanks,
Conrad

#522270

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Conrad,

If that is the case then you should be able to display your view like this.

[wpv-view name='my-view']

Where you will replace my-view with the slug of your view.

Please let me know if this helps.

Thanks,
Shane

#522288

While that shortcode worked, it actually didn't solve my very specific need.

Is there a php code to make a View show up in one of the WordPress template php pages, like in content.php or single.php?

For example, here is how I'm pulling in an individual post into a template .php page:
<?php
$post_id = 42222;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $queried_post->post_content;
?>

...So I was hoping there's a similar way to pull a View into a template php page.

Thanks,
Conrad

#522292

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Conrad,

Actually yes this is possible by using the code in the link below.

https://toolset.com/documentation/programmer-reference/views-api/#render_view

Please let me know if this helps.
Thanks,
Shane

#522530

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Conrad,

Was this able to resolve the issue ?

If so please mark this ticket as resolved.

Thanks,
Shane

#522544

Sorry, I'm not good with PHP, I just copy stuff I find on sites.

Would you happen to know what that php code would look like, where the view ID is "view_id=48509"?

Thanks,
Conrad

#522566

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Conrad,

Yes this is the ID of the view 48509.

Thanks,
Shane

#522618

Oh, I was hoping you'd be able to give me the php code (with the ID inserted). Thanks.

#522621

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Conrad,

No worries, the code should be

$args = array(
    'title' => 'My View name',
);
echo render_view( $args );

Replace My View Name with the actual name of your view.

Thanks,
Shane

#522662

That code worked!

I want to thank you for following my need through all the twists and turns from the original question. (We started with the View button and ended up in PHP).

I'll be sure to leave a good review!

#522664

I left a 5 star rating for Types!

The forum ‘Types Community Support’ is closed to new topics and replies.