dpimental2021
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: dynamic entry-title on page titleI think I know what to do. But, my biggest question is, if I have a page called “Research Articles”, and wanted to change the header title of the page, but just that page, how would I do that?
I know I could use a filter, but how do I use a filter for just one page?
Forum: Fixing WordPress
In reply to: dynamic entry-title on page titleHere’s my issue. I have a page that I am posting to. But, I am posting to it from 4 different pages. I would like to update the header on the page to reflect which page I am posting from. Is there a way to set up a filter / hook for just that page, in my child theme, so it updates the header with that information?
Forum: Developing with WordPress
In reply to: Passing Posted Form Data to ShortcodeThanks Joy.
Much appreciated. I got it to work π
dpimentalForum: Developing with WordPress
In reply to: Passing Posted Form Data to ShortcodeUnderstood. So, all this is handled in the call back function of the shortcode, correct?
Forum: Developing with WordPress
In reply to: Passing Posted Form Data to ShortcodeHere is the code from the wordpress page exactly how I tried using it.
Use this page to find all teachings with a specific word or phrase in the title. Type a word or phrase into the box below and click <span style="font-size: .8em;">SUBMIT</span>. <div id="search"><form action="https://teachings.ssg.church/search-shortcode/" method="post">Search: <input name="term" type="text" /><input type="submit" value="Submit" /></form></div> <div id="teachListBrief"> [addtitlesearch sterm=$_POST['term']]I have tried using just the $_POST and that didn’t work.
The form is posting to the same page the shortcode is on.
So, what am I doing wrong.If I put a literal string, such as “world”, it works.
dpimentalForum: Developing with WordPress
In reply to: Passing Posted Form Data to ShortcodeI did write my own shortcode. The question is, how do I get form data into the call back function of the shortcode?
Forum: Developing with WordPress
In reply to: Creating Custom PHP FunctionsSo, I use this code:
// Add Shortcode function custom_shortcode() { } add_shortcode( '', 'custom_shortcode' );And the empty string ” I put in what I want the shortcode to be named.
And the ‘custom_shortcode’ is the function being connected to the shortcode?
dpimentalForum: Developing with WordPress
In reply to: Creating Custom PHP FunctionsI just want to make sure I am following best practices. I found an example and want to make sure it’s correct.
My goal is to create a plugin and pass a search term to it.
The plugin would then connect to the database, search the database using the search term as criteria and return a formatted result set.So, in the plugin, I was going to do the following.
1. do_action( ‘my_plugin_hook’ );
2. add_action( ‘my_plugin_hook’, ‘my_plugin_echo’ );
3. Create Function
function my_plugin_echo( $url ){
echo “The home url is $url”;
}On my page, I was going to do the following.
1. [my_plugin_hook]Am I doing this correctly?
Can I use the “hook” on any page I want?dpimental
Forum: Developing with WordPress
In reply to: Creating Custom PHP FunctionsMuch thanks for your assistance.
I will try creating the plugin.
dpimentalForum: Developing with WordPress
In reply to: Creating Custom PHP FunctionsWe have a plugin that allows us to enter php code on a wordpress page.
So, I have some code that takes the input of the text box and uses it for the criteria of an sql query.So, I have this code on a page and I want to be able to reuse it, without having the same code on multiple pages.
I was thinking if there was a way to store the code in one place and then simply call it on the pages it was needed that would be helpful.
Is there a way to do that?
dpimentalForum: Developing with WordPress
In reply to: Creating Custom PHP FunctionsSo, here is the actual situation.
I am modifying pages for a church site.
Currently, there are queries against recorded teachings (search by Title or by key word in the description or by Scripture reference.I am modifying the searches to also search written articles on the site, stored in the database.
Here is what I wanted to do – and you can tell me “NO. Don’t do that!”.
I want to take the function I have written on a page and take it out of the page and store it somewhere that I can call it. I would like to call it on the Teaching Search pages as well as call it from pages that only search the articles.What is the best method to achieve this?
dpimental