Skip Navigation

[Résolu] Export toolset data to posts

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

Style a button with CSS codes.

Solution:

It needs custom CSS codes, for emxample:

https://toolset.com/forums/topic/export-toolset-data-to-posts/#post-1638241

Relevant Documentation:

This support ticket is created Il y a 4 années et 6 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 9 réponses, a 3 voix.

Dernière mise à jour par creativeM Il y a 4 années et 6 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1629693

Hi, so my client has uploaded/created 680 resource items that can be seen here lien caché using Toolset.

Now, they want these items shown as posts using the default categories and tags that WordPress offers, is there a way to export these resources into WP Posts, I just tried exporting them and importing but when I import, it just says the post already exists.

Thank you,
Daniel

#1629817

Hi Daniel,

Thanks for asking! I'd be happy to help.

From your message, I understand that you'd like to convert the posts in "Resources" post type into the regular/default "Posts" post type.

If that is correct, you can simply change the post type for these posts using a plugin like "Post Type Switcher" ( https://wordpress.org/plugins/post-type-switcher/ ), as explained in this guide:
lien caché

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1631179
Converted Post.jpg

Dear Waqar,

Thank you for the plugin, it is very quick. I am aware this is not your plugin and you are only trying to help.

I tried converting and the results are undesirable. Please view the attached or view the two links for comparison. The body of the post and other elements such as download button and such are missing, is there any other way you might be aware of that is better than this.

Before conversion: lien caché
After conversion: lien caché

Thank you,
Daniel

#1632301

Hi Daniel,

Thanks for writing back and sharing the update.

The difference in how the converted posts show on the front-end is most likely related to the difference in the assigned content template.

Can you please open the edit screens of both these posts from your last message and see if the same "Content Template" is assigned to both of them?
( example screenshot: lien caché )

I suspect that those newly converted posts at the moment have no or different content template assigned, as compared to the already existing posts. Setting the same content template should make them show the same layout/content.

Please let me know how it goes and you're welcome to share temporary admin login details of both these websites if you'd like me to take a look in the admin area.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1632745

Hi Daniel,

Thank you for sharing the admin access.

The way content presentation is designed on the website, it shows only the "Resources" type posts in a certain way.

For example, if you'll check the "single-resource.php" file in the active theme's folder, you'll see that it is set to show the post's content using the "[wpv-post-body view_template="None"]" shortcode and view "Resources - Resource Media" through the "render_view" function.
( screenshot: lien caché )

The file "single-resource.php" will be used for the single "Resources" type post pages only, but if you'd like your single "Posts" pages, to also use the same layout, you can copy the contents of this file "single-resource.php" into the file "single.php".
( the "single.php" file controls the output of single "Posts" pages ).

Additionally, the theme also applies certain CSS styles like the border around the download link to the single "Resources" type post pages only, by including the ".single-resource" class name. You'll have to add those CSS styles to single post pages too.

Tip: To check which CSS code is applying to different page elements, you can use Google Chrome's inspect element tool, as explained in this guide:
lien caché

regards,
Waqar

#1636209
WhatsApp Image 2020-05-24 at 19.40.31.jpeg

Dear Waqar,

Thank you for the advise, I managed to do it, however, the styles do not show up and I have been trying to figure this out, your support has been amazing. Can you please take a look and see if you can find the reason for this, I am specifically talking about the button and the style not being applied.

Thank you,
Daniel

#1637299

Hello,

Waqas is on vacation, I will take care this ticket.

I can login your website, but I am not sure where I can check.

Please point out the problem page URL, and which button should I check, thanks

#1637833

Please see the live site, this resource is before it was converted to a post lien caché

Please see staging where we had converted and also applied the CSS styling but the download button does not reflect. lien caché

Kindly go through the above conversation to get an idea of what Waqar has been assisting with.

#1638241

Thanks for the details, I have done below modifications in your website:
Edit post view "Resources - Resource Media":
lien caché

In section "Loop Editor", click "CSS Editor", add below CSS codes:

.resource-btn {
	float: left;
    padding: 3px 10px;
    border-right: 1px solid #4d9e2d;
    border-top: 1px solid #4d9e2d;
    border-bottom: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    border-left: 1px solid #4d9e2d;
}
.resource-media {
    border-bottom: 1px solid #4d9e2d;
    margin-top: .5em;
}

Please test again, check if it is fixed, thanks

#1639333

My issue is resolved now. Thank you!