I have a custom page (page-news.php) and I styled it. Now I need to change some texts, and I dont want to do this in hardcoded page-news.php but I want to be able to change that in Wordpress, without go to code. Did you have maybe some ideas how to do this?
Here is visualization of how I think it should work (the only thing I can change would be white custom-text with section-1,section-2 and section-3) and I will be do this in wp-admin > pages >news:
Any ideas? I will be grateful for answer
Use ACF plugin. After installation, you can create custom fields and define their types. In your case, you should create 3 editor field or textarea and attach them to you page. When you visit wp-admin>pages>news you'll see these fields. Use get_field($fieldSlug) in your page template to show the values.
Related
I want to break single WordPress post into multiple pages and i know that i can simply achieve this using wp_link_pages function but unfortunately it's not working for my custom post types. For custom post types it's generating the links but when i click on the link nothing happen.
I have tried to find out the issue but did not got any clue. Is i have to do anything extra for my custom post types to use wp_link_pages function?
You can use the following single code in the position you'd like your content
split.ensure that you are writing the code in the "Text" display editor
rather than the default "Visual display editor(note the two tabs displayed towards the top right in the editor)
<!--nextpage-->
top right of your post or page editing screen)".
I am trying to customize the wordpress template.
In that template the content will be both static and dynamic.
Images, color and button will be static.
All other content will be dynamic.
What I am trying to do is that if i change button name or color in that template it should affect is all place in the sites.
I know about the the_content() I don't know whether split will work.
But is their any to do this process in the form of template.
For Example see the image here
Please need help.
Thank you in advance.
for having dynamic content on your website you can use custom fields..
you can either use the Wordpress built in custom fields or a very good plugin Advanced custom fields (ACF) ..
explanation can be lengthy but you can refer to below documentation and actually it is very simple..
https://codex.wordpress.org/Custom_Fields ( For WP built in Custom fields)
https://wordpress.org/plugins/advanced-custom-fields/ ( for ACF plugin )
Hope this helps
Take care and happy coding
If you just want your first title dynamic, then you can fetch data title from your page like with
the_title();
And all your remaining data will be static in this way you can get your layout easily ... as far as your button pop up message concerned, you can use jQuery to achieve that and can show any of your message. Hope that solves your issue
How can I use a self-made Wordpress plugin to output for example a custom menu or custom HTML to a specific location? The only places I managed to output content is in wp_head and wp_footer, but is it possible to get content to show up anywhere else? Is it even possible to force the plugin to output the HTML for example inside a specific div or a DOM element?
Example scenarios
I want to add a custom button that triggers a menu or modal, but the button needs to be located inside the header and I also need a place for the modal HTML before the footer (example).
I want to add custom made "social share buttons" to every page and need a place to output the HTML after the page title.
Just to give you a feeling of what I'm trying to do...
Maybe I'm just way off track. I am new to this, but I am eager to learn.
"Teach me the ways of the force"
Appreciate any help, Thanks :)
Right now one this certain ACF is only displayed on the user end of the relevant page where generated ACF editor appears.
What I want to do is make a 'global' ACF, featured in certain php include that will appear on most of the pages in my template.
How do I achieve this?
The only way I can achieve this effect is disregard my include, recode each page where I want that global ACF to appear, and then make sure ACF editor appears on each page in wp-admin, which isn't very graceful.
Thanks in advance.
I also had the same issue too. If you still need a solution (or for those who still need an answer) ACF have released a premium add-on called "Options" ACF Options.
This will allow global use of custom fields. Check out the video tutorial on the page to customize the sidemenu for grouped global content.
<?php the_field('field_name', 'option'); ?> will call the content of that particular field.
I hope this helps.
I am not sure exactly what I am looking for in the api so I'm going to ask here. On a post/page, I want the ability to have a piece of text display on the sidebar ONLY that content. The content to be display is to be set as an attribute or something similar in the edit area of that post only.
Is there a way of doing this and where do I look in the api?
Using a text widget as already mentioned, you can use the Widget Logic plugin and use an if statement to display that widget only on the post you want.
http://wordpress.org/extend/plugins/widget-logic/
If you are looking for logic to do this here it is:
In your post you have access to custom variable so create one which you will then access in sidebar and if that is true then a widget can be shown else it does not need to be.
You need to access this custom variable outside post loop which you can use by using global variables and assign its value to that.
In your widget you need to look at globalvariables and check the value of above and then do your if else logic to show or hide parts of content in sidebar.
A good starting point for this can be this tutorial which does show twitter or facebook posts based on custom variable on post.
You can use this plugin and either select pages, post-types or even a comma separated list of post ids http://wordpress.org/plugins/display-widgets/