Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

SimplyRack on "Hack help"

0
0

Linux+cfcd208495d565ef66e7dff9f98764da+01+[[]]

This is I get when I try to access my company website. Where do I go from here to restore my site?


John_McClure on "How to sanitize wordpress subdirectory from displayed paths?"

0
0

How to sanitize wordpress subdirectory from displayed paths?

I installed WP in a subdirectory but find the install folder is displayed in all browser source code.

I'd like to eliminate the subdirectory name from the paths.

Is there a plugin solution or a htaccess solution available?

Thanks for the help!

Trebly on "Stable links to fragments identifiers into paginated posts enhancement"

0
0

Hi,

It seems well that : when paginated posts are used the common fragment identifiers cannot be used easily (see detailed note), because the pages are identified by their number (page=<num_page>) which is not a stable data.
This makes quite impossible to develop and test internal links and maintain long paginated documents with many fragments identifiers because pagination can easily change.

After researches of existing solutions, I decide to develop "something" which is quite fully designed, the feasibility checked, too some main parts of code.

For now, because I am new in WordPress developments I need some help.
I don't think at all that the problem is only a pluging problem.
There are some things that I don't know how to do for hacks.
I do not know anymore where are good existing examples.

The development features are :
(to avoid errors we replace the "page" of paginated post by the "section" word : then a post can have sections)

- A section can be named by the use of a shortcode associated with <!--nextpage--> into the document.
- optional replacement of the url of section identified currently by his number : <permalink>/<num_page>/
by
A new syntax which is the unique way (in my opinion) to reach a fragment into a paginated post
<permalink>/section/<section_name>/

- determine and store the post datas which describes the post sections (needs a wp enhancement - add a column to post table, or badly a special table like for a plugin for storing the pagination data, updated when the post is saved) containing :
post, version : table (json) with for each section (section_name, title, page_num)

Then the steps of url treatment are :
- with a add_rewrite_endpoint it becomes
<permalink>/?section=section_name

- with add_rewrite_tag we can get the new query arg ['section']
- read first the sections data (pagination) from data base using the permalink

Then I need to set into the current query the hook (set by add_action) to set the query var "page=<num_page>", the only known identifier of the "section" known by other WP soft elements.
(I don't know how to do this : must be placed just at the query.php beginning ?)

I am not sure of the sequence of actions (must be the first process : it builds the request for full compatibility giving section_name and old page number) and priorities.

The other parts of the soft with which I have no problem at all are :
- treatment of the content to set the pagination (or sectionning) data (shortcodes)
- writing pagination data at saving posts.

To test, I developed a "at display" treatment which sets
the internal good urls (as shortcodes) into href to fragments. This makes the fragment url identifiers displayed usable (replacement into urls of the section_name by the page number at display).

But the external links cannot be obviously kept anywhere with reliability because links to fragments are broken by any pagination change while section_names are stable data.

I think that it is not a so important work.

I hope this is interesting development.

Best regards

Trebly

________________________________________________________________________
(note :For clarity the concept of an article page is replaced by article "section" (concept which covers easily : parts, main chapters, which uses are naturally extended to summary, bibliography, indexes etc.)

The styling pages link brakes the concept of spaces for html/xml.
A post is no more, with the pagebreak feature a space, it is the section which is, but it is managed as an entity by WP.

The enhancement restores a HTML/XML true space as a section for post paginated : divided into sections.

Then when you creates a document a fragment identifier "#<fragment_name>" cannot be used if a <!--nextpage--> (or equivalent) is used into the document. The URI is unknown. This is proper to the multipage concept not at all to any multipage plugin.

I have not found anywhere information (and I worked a lot on this subject) about the way to define a fragment reference inside a multi page document a tag href or to externally reference a fragment which is contained into a multipage document.
_______________________________________________________________________
remark : It is very difficult to write such projects without any preview of the content of message... sorry I can edit after for a while.

kiannachauntis on "Grab Taxonomy name rather than ID in custom search"

0
0

Hey all!

So, I'm coding my first search filtering system from scratch. I was originally using the Search & Filter plugin, which works like a dream, however with the way in which my client want to style the dropdowns and wire the search differently on certain pages, we've decided to nix the usage of plugins and opt in for coding something with just the bare minimum of what we need to get this working.

That being said, I have a custom post type called "brands" and am currently working to add a handful of custom taxonomies via dropdowns so users may filter their search with ease. I'm really close to getting the code to work, however for whatever reason my current code seems to be grabbing the taxonomy term ID rather than its actual name and applying it to the search.

So, if I am searching by brand location- and I select "California" from the location dropdown, then type clothing- the search url *should* render as

http://www.mywebsite.com/?brand-location=california&s=clothing&post_type=brands

instead- what I'm getting is

http://www.mysite.com/?brand-location=48&s=clothing&post_type=brands

Which obviously displays a "Nothing Found" page as well as a drop of table-flipping rage for myself :p

I'm currently using this code within the search form to display my state location dropdown:

<?php
$args = array('taxonomy' => 'brand-location',
    'hide_empty' => 1,
    'echo' => 1,
    'name' => 'brand-location'
);
if (isset($_GET['brand-location'])){ $args['selected'] = intval($_GET['brand-location']);
}
wp_dropdown_categories( $args );?>

I'm moderately new to PHP, and I'm sure the solution is fairly simple and will make me feel like an uber-n00b for not figuring it out sooner, but I've done quite a few searches at this point and can't seem to find an answer that isn't someone recommending the use of a plugin instead.

Any ideas or help would be appreciated!

zep101 on "What is code for "Recent Posts" in RSS Feed?"

0
0

I am using a mail program AWeber and it has a function to create a blog broadcast that gets converted to into email that I send and has my latest post from my wordpress site.

It has a side column that I would like to show recent posts in. Is there a way to add this?

The existing items are being brought in with code similar to these:
{!rss_item_title}
{!rss_item_content}

What kind of code can I use for recent posts?

functionsp on "My Wordpress side hacked"

Dave Navarro, Jr. on "Remove the {View ...} Button"

0
0

Is it possible to review the {View Posttype} button on the edit page for custom post-types?

vivoeusebio on "Click, load page, then do something depending on what was clicked"

0
0

Hi. I'm working on a child theme of Twenty Thirteen - http://mrem.byethost9.com/ - using Isotope (http://isotope.metafizzy.co/).
The website is for an illustrator and I'm using Isotope to filter through her works, that are displayed on the home page. I've got that part working with two menus that are filters - "ilustração" and "oficinas", each with their own sub-menus, that are also filters. This part is working.
When I go into another page, like "contactos", however, this complicates things. If I click the filters, I need first to return to the homepage and then filter the posts. I can only do the first part, like this:

//filterMenuItems contains the menu items that will filter the posts.
filterMenuItems.each( function (index) {
var itemLink = $(this).children("a");
itemLink.click( function() {
if (!isThisHome()) { //if we're not currently on the homepage, where filtering happens, then go to home page.
window.location.href = urlHome;
}
filterPosts(this); //function that does the filtering.
});

What I need is to check, each time the home page is loaded, if it came from a different page, and if so, what menu-item was clicked. If it was a filter menu item, then it needs to filter the posts. I'm guessing this is possible with some sort of event listener, but I'm not sure how to do that part. Can anyone give me a hint?

Thank you.


Idaseeh on "'strange' followers?"

0
0

I don't know if I have to worry, but during the last 24 hours I've had a lost of new 'followers' - all with a yahoo.com adress and 4 numbers in their names . . . my blog is entirely in Danish, and I therefor wonder what is going on . . .
shall I delete the 'followers'?

Trebly on "Need help in hacking for url rewrite and set new added query value for posts"

0
0

Hi,

I need some help to develop a hack :
I am new in WP development I begin to understand most of soft contents (plugin not yet published, hacks, themes...) but not sure at all in the following :

I have to do:

  1. Add endpoint using add_rewrite_endpoint seems easy
  2. Add query value add_rewrite_tag we can get the new query arg ['section']
  3. Before the analyse of query : read data (new column) for a post, determine and set the query value for the new query arg

The other plugin extensions are OK, I can normally develop or have developed without difficulties.

I am not sure of the sequence of actions (must be the first process : it builds the request for full compatibility giving section_name and old page number) and priorities.

Thanks
Best regards

Trebly
__________________________________________________________________________
note : I detail the development reasons and design in :

tomwpumford on "Edit dashboard based on user id NOT user role"

0
0

Is there a way to edit the dashboard based on the user ID? I know this is relatively straight forward when targeting a user role, but how about ID?

For a working example, something along the lines of changing the admin menu background color for the user ID of 7.

The general goal is that I wont to have 2 super admins that control the multisite although one of the super admins has little experience in wordpress so Im trying to style the back to a very very basic set up. I have have used the Extended Super Admin plugin to remove capabilities so I guess it would something along the same lines of that

amitbhgt on "Frustrate from Hack Again and Again... :("

0
0

Hi everyone
i have some issue with wordpress i don't why my all wordpress websites are hack even after apply securities and plugins i use .htaccess securities, generate Custom Secret Keys, Disable Theme Editor Option, limited file access in wp-content folder, protected admin are but nothing work for me.

After applying all securities i thought problem is in my hosting company, i shift my reseller to leading hosting company but today i again hack.. :( don't know where is the loop hole. i have hack problem only with wordpress nothing wrong with custom coding site or shopping cart. please help if nothing work. i have to learn and shift to another cms software.

JungleJack on "Remove tags from rss feed"

0
0

Hi all,

i'm not much of a big PHPwizard, and that is why I hope someone could help me out. Since some of my people are addicts to tags, the RSS feed gets really messy with categories, because tags are converted to cagetories in the feed. Is there a way to keep the categories, but remove the tags from the feed?

Hope someone could help me out.
Thanks in advance,
Mike

(question was in Hacks & Plugins, closed it there since it wasn't about a plugin)

Dave Navarro, Jr. on "Filters on Post-Meta Text"

0
0

So, I have several plugins installed that do things like auto-converting URLs to links, creating links from certain phrases and keywords and such in post content.

I would like to run those filters on text stored in post-meta. Not sure which function or filter to call to do that.

My google searches keep coming up with the_post() and stuff about AutoP.

bloomindustries on "Accordian PHP Help Needed"

0
0

I am asking for desperate help after spending at least 4 hours trying to work this out...

I am using a Wordpress/Woocommerce theme which has an Accordion short code.
I am trying to put the shopping cart variations (preferred product color etc) into the drop down accordion (for info this is due to the huge number of variations my customers may have).

With help from the WP Codex this seemed simple enough however I just can't get the code to work (see below). I have successfully tested the accordion and the PHP independently - I just need to merge them together somehow.
I am new to PHP so please bear with me...

I have declared the chunk of PHP first (which also contains HTML) and then finally put it into the short code:

<?php $details = foreach ( $item_data as $data ) :
			$key = sanitize_text_field( $data['key'] );

		'<dt class="variation-'

echo sanitize_html_class( $key ); '">'
echo wp_kses_post( $data['key'] ); ':</dt>'
		'<dd class="variation-'
echo sanitize_html_class( $key ); '">'
echo wp_kses_post( wpautop( $data['value'] ) );
'</dd>'
endforeach; ?>

<?php echo do_shortcode( '[accordion][accordion-item title="Details"]' . $details . '[/accordion-item][/accordion]' ); ?>

I would be so grateful if someone could look over it and tell me what I'm doing wrong.
If you need me to explain further about what I'm trying to do just let me know.
Cheers : )


suneetpant on "how value returned from jquery can be used as a php variable"

0
0

hi there, Pls help. For the last two days I am unable to resolve this problem:
Part -1 :| I am trying to pick the value of the first column of the Table-1 &
Part -2 :| based on the selection and clicking a button on the basis of the
| value in a textbox trying to show rest of the detail in the Table-2

Part-1 : is working fine, but
Part-2 : using jquery I am able to show the value in a text box. Now when I try to pick the value from the text box, the value returning is NULL. why?
Below is my code :

<?php include ("dbcon.php"); ?>

<!DOCTYPE html>
 <html>
  <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="workstyle.css">
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script>
      var a;
      function getdatafromddl(){
         a = document.getElementById("payflag").value;
         location.href="?a="+a;
      }
    </script>

    <script>
      $(document).ready(function() {
         var selectedRow;
         var record;
         $('tr').click(function () {
            $('tr').removeClass('selected');
            $(this).addClass('selected');
            selectedRow = $(this);
         });

         $('#viewbtn').click(function() {
            var td = $(selectedRow).children('td');
            alert(td[0].innerText);
            var id = td[0].innerText;
            $('#order').val(id);
         });
      });
    </script>
  </head>

  <body>
    <div align="center">
       <img src="images/menu.jpg" alt="" />
    </div>
    <div class="centr-div">
      <!---------------------------------------------------------- Row 1 [Start]-->
      <div class="f-col"> <label id="statdd">Show orders on basis of&nbsp;&nbsp;:&nbsp;&nbsp;</div>
      <div class="s-col">?>
	<select id="payflag" onchange="getdatafromddl()" class="pay">
	  <option value = "-1">---- Selection ----</option>
	  <option value = "Paid" <?php if($_GET['a'] == 'Paid') echo "selected"; ?> >Paid</option>
	  <option value = "Un-Paid" <?php if($_GET['a'] == 'Un-Paid') echo "selected"; ?> >Un-Paid</option>
	</select>
      </div>
      <div class="l-col"><input type="text" id="order" name="txtorder" /></div>

      <!-- *********************   Table - 1   *************************************************  -->
      <?php
         if (isset($_GET['a'])) {
             $val = $_GET['a'];
	 }
	if(!empty($val)){
	  if ($val == 'Un-Paid')
	  {
	    $getrecs = "SELECT u.t_ordid, DATE_FORMAT(u.tord_dt,'%d-%m-%Y') as label_date, c.u_name, s.stat_desc  FROM utmp_orders as u join user_dtls as c on c.user_id=u.user_id join status as s on s.stat_cd=u.stat_cd WHERE u.pay_flag='N'";
	    $retrv = mysqli_query($connection, $getrecs);
  	  }else if ($val == 'Paid') {
		$getrecs = "SELECT u.t_ordid, DATE_FORMAT(u.tord_dt,'%d-%m-%Y') as label_date, c.u_name, s.stat_desc  FROM utmp_orders as u join user_dtls as c on c.user_id=u.user_id join status as s on s.stat_cd=u.stat_cd WHERE u.pay_flag='Y'";
	 	$retrv = mysqli_query($connection, $getrecs);
	  }
	  else{ $retrv="";}
	}
      ?>
      <table id='show-recs'>
         <thead>
          <tr>
            <th>Order No.</th>
            <th>Order Dt.</th>
            <th>Client Name</th>
            <th>Status</th>
          </tr>
        </thead>
<?php
	if (!empty($retrv)){
	while($retrvarr = mysqli_fetch_assoc($retrv)){
?>
	<tbody>
		<tr>
			<td><?php echo $retrvarr["t_ordid"] ?></td>
			<td><?php echo $retrvarr["label_date"] ?></td>
			<td><?php echo $retrvarr["u_name"] ?></td>
			<td><?php echo $retrvarr["stat_desc"] ?></td>
		</tr>
	</tbody>
<?php }} ?>
				</table>
				<div class="spc"></div>
				<div align="center"><input type="submit" id="viewbtn" class="showViewbtn" value="View Selected Record" /></div>
				<div class="spc"></div>
		<!-- *********************   Table - 2   *************************************************  -->
				<?php
					if (isset($_POST['txtorder'])){
$ono = $_POST["txtorder"];
					}

					//$ono = 2;
					if(!empty($ono)){
$selrec_query = "SELECT u.file_path, u.lbl_qty, u.lbl_prc, s.scat_name FROM utmp_orders as u join subcategory as s on s.scat_id = u.scat_id where u.t_ordid = {$ono}";
$result = mysqli_query($connection, $selrec_query);
					}
				?>

				<table id='show-sel-recs'>
<thead>
	<tr>
		<th>Label Image</th>
		<th>Qty</th>
		<th>Price (&pound;)</th>
		<th>Category</th>
		<th>Payment Recd</th>
	</tr>
</thead>
<?php
	if (!empty($result)){
	while($resultarr = mysqli_fetch_assoc($result)){
?>
		<tbody>
			<tr>
				<td><img src="<?php echo $resultarr['file_path'] ?>" alt="" style="width:61px; height:54px" /></td>
				<td><?php echo $resultarr["lbl_qty"] ?></td>
				<td><?php echo $resultarr["lbl_prc"] ?></td>
				<td><?php echo $resultarr["scat_name"] ?></td>
				<td></td>
			</tr>
		</tbody>
	<?php }} ?>
				</table>

			</div>
	</body>
</html>
<?php //get_footer(); ?>

360zen on "Another get_pages() question"

0
0

Okay, I'm back with one more question about getting child pages with get_pages().

What I'm attempting to do is look at the current page's child pages, if it has a child page with a specific taxonomy term, show the child instead of the parent.

I've got this working almost 100% of the time, however, I just ran into a weird problem with the home page.

Here's how I've got the pages set up

  • Home (set to Front Page)
    • Alt Home Page*
  • About Us
    • Mission
      • Alt Mission Page*
    • History
      • Alt History Page*

The get_pages code I'm using is this (you can see the rest of the code here):

$args = array(
		'child_of' => $pid,
		'hierarchical' => 0,
	);
$children = get_pages($args);

This setup is giving me exactly what I want on every page except for the home page. On the Mission page, I get the Alt Mission page (and other children of Mission page) in a list, check for the taxonomy term, and then shows the one with the taxonomy term (the Alt Mission page).

On the home page, I get a list of all pages **including the home page itself** (because apparently WordPress sees them all as children of the home page), so when I search for the taxonomy term, it finds every page with this taxonomy term and then shows the content for (I'm assuming here) the last one it finds: the Alt History Page. If I add 'parent' => $pid, only top level pages are returned.

So, my question is: How can I get only direct descendants of the Home page? Do I need to check is_front_page() and handle the Home page differently (provide a specific ID to use)?

Any help would be much appreciated.

joshjacobson on "How can I customize the views count for each post count?"

0
0

I am using the voice theme, and I'd like to customize the views count for each post.

pepe on "wp_verify_nonce fails when preview drafts"

0
0

Since several versions of WP ago (probably 3.9 or 4.0, but maybe earlier), I can't view post or page drafts when the custom theme for my blog is activated. This is specific to the "Edit Post"/"Edit Page" screen, i.e. with the nonce added to the request URI.

I've traced the problem through core and it appears that the call to wp_get_current_user() fails because $current_user contains, for this brief instance, a valid but empty WP_User object. So far, I have not been able to find out why this happens with the custom theme (originally based on The Erudite, but heavily modified since). I am not calling ANY user related functions (at least as far as I can see). To the best of my knowledge, I'm not calling anything before init at all.

What's more, on my single site development version, the problem is not reproducible. It only shows on the multisite production environment. Any suggestions which WP functions could possibly "damage" $current_user?

t_robinson on "Creating custom admin menu similar to 'Settings' page"

0
0

I'm currently running a multi-site instillation of WordPress and have a bundle of custom built plugins running which I am trying to tidy up within the admin area. Some sites require all of the plugins and some require none. I am working on creating a new plugin that adds a new admin page and lists all of the plugin's admin pages under this new page which doesn't want to be displayed if a site has no plugins activated.

I have created a custom 'Core' plugin with a prefixed version of the WordPress add_submenu_page function which acts in a similar way. This function created the parent menu each time the function is called (which means it will not create it if it already exists) and then will register a sub-page.

I have managed to get this all working however the parent page is listed as a sub-page under its self. I am looking to hide the parent page from the sub-menu and when clicked on from the left-hand menu, it will re-direct to the first admin page in the sub-menu however this doesn't seem to be going to plan.

Viewing all 8245 articles
Browse latest View live




Latest Images