最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

theme development - How to use plugin's shortcode in custom design?

programmeradmin3浏览0评论
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question

This might be a beginner question, for disclaimer I'm just getting used to the WordPress templating system:

I have a purchased theme installed on my working WordPress site, looking great sofar, was relatively easy to setup.

I installed a plugin for members functionality (Ultimate Member), then I wanted to list a group of members I created in the design with the following shortcode:

[ultimatemember form_id="xxxx"]

It displays a list of my members, fine, but in some kind of default design (header/footer, other contents are ok, like the template, I can put stuff before or after the generated list, but the member's thumb and info are not exactly as it needs to be as per client's requests)

On the other hand, my template's "Meet the Team" page which I intend to use is only a combination of "Mikado Team" elements in the page editor, where I can input team member informations right away, in text format.

How do I implement Ultimate Member's listing to a template like that? In my imagination that would be like setting the specific datas assigned to design parts, like I have on the "Meet the Team" template page:

[mkdf_team team_name="Jane Doe" ... etc data settings]

How do I set the datas to be as the member list of Ultimate Member?

The only thing I could think of is modifying the "members-grid.php" file as it controls how Ultimate Member displays those lists, but I'm sure there's an easier solution for this. :)

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question

This might be a beginner question, for disclaimer I'm just getting used to the WordPress templating system:

I have a purchased theme installed on my working WordPress site, looking great sofar, was relatively easy to setup.

I installed a plugin for members functionality (Ultimate Member), then I wanted to list a group of members I created in the design with the following shortcode:

[ultimatemember form_id="xxxx"]

It displays a list of my members, fine, but in some kind of default design (header/footer, other contents are ok, like the template, I can put stuff before or after the generated list, but the member's thumb and info are not exactly as it needs to be as per client's requests)

On the other hand, my template's "Meet the Team" page which I intend to use is only a combination of "Mikado Team" elements in the page editor, where I can input team member informations right away, in text format.

How do I implement Ultimate Member's listing to a template like that? In my imagination that would be like setting the specific datas assigned to design parts, like I have on the "Meet the Team" template page:

[mkdf_team team_name="Jane Doe" ... etc data settings]

How do I set the datas to be as the member list of Ultimate Member?

The only thing I could think of is modifying the "members-grid.php" file as it controls how Ultimate Member displays those lists, but I'm sure there's an easier solution for this. :)

Share Improve this question asked Jun 6, 2019 at 5:04 NimueNimue 11 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 0

I am guessing your are talking about customizing the look of the output from the shortcode to match the design of the page better is that correct? If so then I would style it using Firebug and CSS.

I was able to solve this by installing a plugin called Custom Content Shortcode then using a code snippet like this right from the page editor:

[raw]
   [users role=um_custom_role_1]
      [pass user_fields=fullname]
         [mkdf_team team_name="{FULLNAME}" ... etc data settings]
      [/pass]
   [/users]
[/raw]

Where:

  • [raw] is just a code wrapper for formatting issues (did not work properly without it)
  • [users role=um_custom_role_1] is the loop of members of my custom role (which I created with Ultimate Member plugin)
  • [pass user_fields=fullname] is a wrapper for the member's data pull (several options for these are available in Custom Content Shortcode's plugin settings panel/documentation, it's quite neat and handy)
  • [mkdf_team team_name="{FULLNAME}" ... etc data settings] is the theme's shortcode for the team members list, and for this example snippet the user's full name is displayed in the field accordingly (from here, anything you pass can be displayed as individual data in the markup, parameters are listed in the documentary, but it's basically like handy variables for the loop, therefore easier to implement in the design as you wish to do)

Voilá! :)

And I didn't even use a single line of php.

(No offense, but I think we have better things to do than hard coding templates into plugin php files xD by the way it's easier to manage future theme changes, you just modify this snippet without going trhough the trouble of modifying php files)

I hope this made sense and someone with similar issues might find this useful in their cases. Cheers. ;)

发布评论

评论列表(0)

  1. 暂无评论