How would I remove this from all wordpress posts - wordpress

In every wordpress post I have code like this -
<img src="http://domain/wp-content/uploads/2016/08/Black-Bosch-Avantixx-HBM13B261B-Electric-Double-Oven-300x266.jpg" alt="black-bosch-avantixx-hbm13b261b-electric-double-oven" width="300" height="266" class="alignright size-medium wp-image-367913" />
Obviously each post is a different name, how can I remove this paragraph inside all posts as I have thousands.
Is there a command I can do using phpmyadmin?
Step by step would be great thanks.

You have try to delete the img? Do you have use some plug-in downloaded from external website? I don't think you need db i think it's something in JS or php if this you can use add to your js file:
$(document).ready(function() {
$(".wp-image-367913").css("display","none")
});
If it's only the code, you need to check your article.php or single.php or your post php page file and see if there are this link write some where.

Related

Wordpress - TwenteenSeventeen picture instead of a title

I'm really new in coding, especially in css. I already read some tutorials but I like to change a specific thing. For my Website I use Wordpress. I also edited a few things in my CSS which already worked. Now I can't find a answer for how I can replace the title with a custom picture.
Click here to watch a picture to understand what I mean.
Click here to acess my website.
I already tried some things, but it would be nice if someone can explain me how to do it.
You can edit header.php in the twenty seventeen to display only a picture.
This source code is on your wordpress server in wp-content/themes/twenty-seventeen/header.php: https://github.com/WordPress/twentyseventeen/blob/master/header.php
You'll want to replace line 31:
<?php get_template_part( 'components/header/header', 'image' ); ?>
With something like
<img src="banner.png" />
You'll have to adjust the location of banner.png to where you actually upload the image.
After you've got that working and it's basically what you want, you can wrap the image tag in a a tag so the banner links back to your home page, if you'd like.

Add shortcode inside another with echo

I try to nest a shortcode to another in my page. Why this isnt working?
[toggle]
<?php echo do_shortcode('[Best_Wordpress_Gallery id="1" gal_title="my"]'); ?>
[/toggle]
There's not enough information in your code sample to say for sure. However, it looks like you are attempting to put PHP code into an actual WordPress page/post. Is that the case? If not, please provide more info on what you're trying to do exactly.
If so, you can't put PHP inside post/page content in WordPress without enabling the ability to do so. The easiest way to do this is with a plugin. There are several in the Plugin Directory: https://wordpress.org/plugins/search.php?q=php+code.
Also, see this answer for a similar question: https://stackoverflow.com/a/18896308/3147332

Joomla module positions not working

I'm using Joomla, and as far as I can tell I have done everything right for my template, but can't get Module positions to work
I have the correct XML file setup I think and this is my HTML tag:
<jdoc:include type="modules" name="topnav">
The page is X if you look at the page source it is rendering that tag - I would expect that to disappear, and to be replaced with the content I have told the Joomla backend to put there?
Very confused!
Try this-
<jdoc:include type="modules" name="topnav" />
You are missing closing tag.
let me know if this does not work.
How are they not working? Are the positions updating in admin, but not on the website? Or are they not updating in the admin page too? From what I remember of Joomla, you have to click on the 'save' icon once you've rearranged all your positions.

Permalink-safe way to link pages inside footer.php

I am currently building a new theme for my site and am kind of stuck not knowing the proper way to link pages together. What is the proper way to direct visitor to another page if I were to write the link straight into footer.php?
Let's consider the following inside footer.php:
?>
A Link
<?php
That would work well up until I were to change my permalink structure to something else.
What is the proper way to do it(without using WP built in menus or anything similar)?
You can use get_permalink assuming your pages are in Wordpress.
See this link: http://codex.wordpress.org/Function_Reference/get_permalink
The above answer is 100% correct, but to save people some time when they stumble upon this question, I took the liberty of writing it out.
<?php echo get_the_title(12); ?>
This covers everything from hover text to dynamic page title, so if you decide to change "Contact" to "Contact Us," you won't have to remember to update the footer.php file.

How to pass data between wordpress pages

I am new to wordpress and i want to transfer data from one page to another in wordpress. I used php to post my form data to a wordpress page. My code is:
<form method='post' action='http://www.example.com/www/create_website/'>
.....
<input type ='submit' value = 'OK'/>
</form>
But every time i clicked the submit button i got error page not found. Why it is so because link is loading the page in browser but not working for form post. How can i solve the issue???
Having spent about a day figuring out how to do this, I thought it might be helpful to others in the stackoverflow community.
GOAL: To take the results from a form field and use it on another page.
In this example, my client wanted users to be able to fill in any amount in a text field to make a Paypal payment. I'm using S2Member plugin to create buttons and hook up the Paypal payments, but they did not offer this functionality --only buttons with hard wired amounts.
You can see this in action here:
http://virginiabloom.com/?page_id=250 . But it is LIVE. If you start a paypal payment, it WILL deduct money from your account. Which will make Virginia very happy.
HOW I SOLVED IT:
First, I created a form just for this field.
Enter Other Payment Amount $
Next, I found a very simple plugin on stackoverflow and adapted it to my needs:
<?php
/*
Plugin name: redirect on post
Desciption:
http://stackoverflow.com/questions/13686245/how-to-create-a-custom-url-based-on-dropdown-in-wordpress-form-submission
I-changed-dropdown-to-field-input
*/
function redirect_on_submit() {
// check if the post is set
if (isset($_POST['amount']) && ! empty ($_POST['amount']))
{
header( "Location: yourUrl.com/?
page_id=542&amount=" . $_POST['amount'] );
}
}
add_action('init', redirect_on_submit);
NOTE: Change the page URL and ID information in the header to point to the Wordpress page you want to send the information to.
If you don't know how to manually install a plugin, its very simple.
Save the snippet as a .php file. Open up your hosting account and find the plugins folder (its in the wp-content folder) Copy the file into the folder.
Go back to Wordpress and look at your plugins. You should see it there. If its not activated, the activate it.
I installed another plugin:
Allow PHP in Posts and Pages (Version 3.0.4)
After installing it, the plugin will appear on the Wordpress menu.
Open it and you can use their snippet maker that will put php into your post inside a short code.
Configuration:
Show the snippet not found message: yes (for debugging)
Use the old (pre.2.2 code: no
Use the advanced filter method: yes
Remove all plugin data on install: no
You should see the code snippet box appear at the bottom of the page.
My snippet was simple. I just wanted to echo the "amount" parameter from the page url. So it looked like this:
echo $_GET['amount']?>
Note that you have to put the ending php tag, but not the beginning tag.
Now, you just use the shortcode [php function=1] on the page wherever you want to get this parameter.
Here's what it looks like on MY results page.
<h2>Payment of $ [php function=1]</h2>
<strong><em>Click Paypal button to start payment or cancel.</em></strong>
[s2Member-PayPal-Button sp="1" ids="xxx" exp="24" desc="Payment" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="yoururl.com"
ra="[php function=1]" image="default" output="button" /]
To make sure that users can only enter in decimal numbers, I used jQuery validation on the form. There are other ways to do it, but this was very simple. Just put this code on the page with the form which I've included below.
<form id="myform" action="http://virginiabloom.com/?page_id=542" method="post"><span style="font-size:1.5em;">Enter Other Payment Amount $</span><input id="amount" class="left" name="amount" type="text" /><input type="submit" value="Submit" /></form>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://jquery.bassistance.de/validate/jquery.validate.js"></script>
<script src="http://jquery.bassistance.de/validate/additional-methods.js"></script>
<script>
$( "#myform" ).validate({
rules: {
amount: {
required: false,
number: true
}
}
});
</script>
That's it! I hope this helps somebody.
If you need to go to one of your WordPress page, please don't put the direct link in action.
Instead of that put the below php code.
<form method='post' action='<?php bloginfo('url'); ?>/your-page-name/' >
If you wants to go to a particular file inside your template directory put the below code
<form method='post' action='<?php bloginfo('template_url'); ?>/your-page.php' >
Check this WordPress codex page for more about bloginfo.
<?php bloginfo('url'); ?>
will generate the base site url.

Resources